20 Oct, 2008, David Haley wrote in the 121st comment:
Votes: 0
FWIW I try to stick to ~90 chars. That's mainly so that I can have my vi window split down the middle and see two buffers vertically.
20 Oct, 2008, quixadhal wrote in the 122nd comment:
Votes: 0
Argh! N00b mistake. I forgot to convert tabs to spaces first. :)

Ok, so a brain-dead conversion yields the table below. The real result would be somewhere in-between, since not ALL tabs would become 8 spaces. Tabs are evil, after indent, anyone putting a tab literal in the code will be humiliated on slashdot or something.

The codebase contains 44851 lines of code.
The overall average line length of the codebase is 29.5710909455753 characters,
and the overall longest line is 111 characters.
Length 111 1
Length 103 1
Length 99 1
Length 98 2
Length 97 3
Length 96 2
Length 95 6
Length 94 5
Length 93 8
Length 92 16
Length 91 27
Length 90 19
Length 89 45
Length 88 38
Length 87 52
Length 86 66
Length 85 64
Length 84 106
Length 83 202
Length 82 77
Length 81 180
Length 80 245
Length 79 320
Length 78 300


The dropoff point has moved from about 81 to about 92, which means it's really probably around 86. I'll run the code through with it set at 90 and at 94 and see what it looks like.
20 Oct, 2008, quixadhal wrote in the 123rd comment:
Votes: 0
ROFLMAO!

From ye olden days, I've know indent to occasionally break things. The goal is, of course, to indent things and then hand-clean them to the point where running them through indent again doesn't change them. Maybe we'll get there, maybe not. But this is amusing… and it still compiles.

In magic.c, the function is spell_nexus(). This monstrosity:
if ( ( victim = get_char_world( ch, target_name ) ) == NULL
|| victim == ch
|| (to_room = victim->in_room) == NULL
|| !can_see_room(ch,to_room) || !can_see_room(ch,from_room)
|| IS_SET(to_room->room_flags, ROOM_SAFE)
|| IS_SET(from_room->room_flags,ROOM_SAFE)
|| IS_SET(to_room->room_flags, ROOM_PRIVATE)
|| IS_SET(to_room->room_flags, ROOM_SOLITARY)
|| IS_SET(to_room->room_flags, ROOM_NO_RECALL)
|| IS_SET(from_room->room_flags,ROOM_NO_RECALL)
|| victim->level >= level + 3
|| (!IS_NPC(victim) && victim->level >= LEVEL_HERO) /* NOT trust */
|| (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON))
|| (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) )
|| (is_clan(victim) && !is_same_clan(ch,victim)))
{
send_to_char( "You failed.\n\r", ch );
return;
}


got turned into this beastie!

if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || ( to_room = 
victim->in_room ) == NULL || !can_see_room( ch, to_room ) || !can_see_room( ch, from_room ) || IS_SET(
to_room->room_flags, ROOM_SAFE ) || IS_SET( from_room->room_flags, ROOM_SAFE ) || IS_SET(
to_room->room_flags, ROOM_PRIVATE ) || IS_SET( to_room->room_flags, ROOM_SOLITARY ) || IS_SET(
to_room->room_flags, ROOM_NO_RECALL ) || IS_SET( from_room->room_flags, ROOM_NO_RECALL ) ||
victim->level >= level + 3 || ( !IS_NPC( victim ) && victim->level >= LEVEL_HERO ) /* NOT



* trust



*/
|| ( IS_NPC( victim ) && IS_SET( victim->imm_flags, IMM_SUMMON ) )
|| ( IS_NPC( victim ) && saves_spell( level, victim, DAM_NONE ) )
|| ( is_clan( victim ) && !is_same_clan( ch, victim ) ) )
{
send_to_char( "You failed.\n\r", ch );
return;
}


Yeah, when indent does something like that to your code, it might be a subtle hint that you should rethink how you're writing it.
20 Oct, 2008, Vassi wrote in the 124th comment:
Votes: 0
Holy crap.

Good thing they used /*comments*/ otherwise it probably would have broken.
21 Oct, 2008, David Haley wrote in the 125th comment:
Votes: 0
This is one reason why I don't use indent. But I do have to wonder how it managed to produce something quite that monstrous. :wink:
22 Oct, 2008, quixadhal wrote in the 126th comment:
Votes: 0
Two interesting facts about indent, which I learned from this codebase.

It doesn't handle comments inside of C code very well… so things like if(foo && bar /*silly*/ && ack) tend to break things.
It also doesn't really like comments in this style:
if(foo)
{
blah();
}
else /* I fail */
{
ack();
}


Sooooo, please don't do those in RaM code. :)

Anyways, the indented version of the source is now available in the latest revision (16!) of the RaM SVN repository. Since it's such a large amount of textual change, I'll also upload a .tar.bz2 archive snapshot.

You can see the settings used in the spiffy new .indent.pro file that's in the src/ subdirectory. Hopefully, it won't be too horrible for anyone. There are a couple of rough edges yet that I'll probably address, but all in all, I think it looks reasonable and should keep things tidy.
22 Oct, 2008, Igabod wrote in the 127th comment:
Votes: 0
WOW 9 pages of messages on one thread in just 15 days… i haven't read anything on this thread since it got up to 4 pages so i don't even know if it's all related but sheesh that's a LOT of messages in such a short time on one thread. i really don't have anything useful to say, i just wanted to comment on that :smile:
22 Oct, 2008, Sandi wrote in the 128th comment:
Votes: 0
Thanks for all your effort, Quix.
22 Oct, 2008, Avaeryn wrote in the 129th comment:
Votes: 0
Sandi said:
Thanks for all your effort, Quix.


Quix is the man, isn't he? Plus, he gives me contact hyperactivity from just being around him. There is such a thing, isn't there? :wink:
22 Oct, 2008, Conner wrote in the 130th comment:
Votes: 0
Avaeryn said:
Quix is the man, isn't he? Plus, he gives me contact hyperactivity from just being around him. There is such a thing, isn't there? :wink:

Is this something you'd want your husband to know about? :wink:
22 Oct, 2008, quixadhal wrote in the 131st comment:
Votes: 0
Excellent! I've got them all fooled! Muahahaha! :devil:

Seriously, you think I'm busy…
23 Oct, 2008, Avaeryn wrote in the 132nd comment:
Votes: 0
Conner said:
Avaeryn said:
Quix is the man, isn't he? Plus, he gives me contact hyperactivity from just being around him. There is such a thing, isn't there? :wink:

Is this something you'd want your husband to know about? :wink:


:tongue: You're such an instigator, Conner!

Besides, what's wrong with contact hyperactivity? Unless it means you end up breaking that special vase his Aunt Thelma gave you umpteen gazillion years ago accidentally-on-purpose!

quixadhal said:
Excellent! I've got them all fooled! Muahahaha! :devil:

Seriously, you think I'm busy…


You haven't got anyone fooled, quix! I knew when you showed up at the first meeting with orange hairs on your clothing. Not to mention, the purring gave you away in seconds. :lol:
23 Oct, 2008, Conner wrote in the 133rd comment:
Votes: 0
Avaeryn said:
Conner said:
Avaeryn said:
Quix is the man, isn't he? Plus, he gives me contact hyperactivity from just being around him. There is such a thing, isn't there? :wink:

Is this something you'd want your husband to know about? :wink:


:tongue: You're such an instigator, Conner!

Besides, what's wrong with contact hyperactivity? Unless it means you end up breaking that special vase his Aunt Thelma gave you umpteen gazillion years ago accidentally-on-purpose!

Instigator? Me?? Never! :lol:
Now, unable to resist an obvious opening for a little harmless humor, that'd be a horse (cat?) of another color… :wink:

As for what's wrong with contact hyperactivity, nothing really, except the contact aspect if hubby is the really jealous type. :wink:
23 Oct, 2008, David Haley wrote in the 134th comment:
Votes: 0
I have to wonder if I'm missing a cultural reference w.r.t. "contact hyperactivity"… :smile:
23 Oct, 2008, Avaeryn wrote in the 135th comment:
Votes: 0
DavidHaley said:
I have to wonder if I'm missing a cultural reference w.r.t. "contact hyperactivity"… :smile:


Yes, you are perhaps. Contact hyperactivity, obtained from being around someone who is hyper. Same as a contact buzz from being around someone smoking doobies. Hope that helps. :smile:
23 Oct, 2008, David Haley wrote in the 136th comment:
Votes: 0
Heh, see, I'm glad I asked, because that's not how I was parsing the expression. :wink:
23 Oct, 2008, quixadhal wrote in the 137th comment:
Votes: 0
You were probably thinking of "hypercontact activity". Since I'm single, I'm allowed to fully endorse and support that message too, but it isn't quite the same. :cool:
24 Oct, 2008, Avaeryn wrote in the 138th comment:
Votes: 0
DavidHaley said:
Heh, see, I'm glad I asked, because that's not how I was parsing the expression. :wink:


Umm…ok. :redface: Dare I ask how you were parsing it? :lol:
24 Oct, 2008, David Haley wrote in the 139th comment:
Votes: 0
If I'm thinking along the same lines as Quix, then he's got the right idea :wink: I was parsing contact as the thing being done with hyperactivity, not that it is hyperactivity passed on by contact… :cool:
24 Oct, 2008, Vassi wrote in the 140th comment:
Votes: 0
DavidHaley said:
If I'm thinking along the same lines as Quix, then he's got the right idea :wink: I was parsing contact as the thing being done with hyperactivity, not that it is hyperactivity passed on by contact… :cool:


For what it's worth, i parsed it correctly the first time.

Damn programmers, should get out more. -mumble- :wink:
120.0/181