MudBytes
» MUDBytes Community » Codebase Specific » DikuMUD » Rom » RaM » Hear ye! Hear ye!
Pages: << prev ... 7, 8, 9, 10, 11 ... next >>
Hear ye! Hear ye!
David Haley
Wizard






Group: Members
Posts: 6,913
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#121 id:14171 Posted Oct 20, 2008, 2:02 pm

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.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

quixadhal
Wizard






Group: Members
Posts: 1,473
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#122 id:14172 Posted Oct 20, 2008, 2:29 pm

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.

Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

quixadhal
Wizard






Group: Members
Posts: 1,473
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#123 id:14183 Posted Oct 20, 2008, 4:53 pm

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:
Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
        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!

Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    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.
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

Last edited Oct 20, 2008, 4:56 pm by quixadhal
Vassi
Conjurer






Group: Members
Posts: 182
Joined: Sep 24, 2008

Go to the bottom of the page Go to the top of the page
#124 id:14184 Posted Oct 20, 2008, 5:15 pm

Holy crap.

Good thing they used /*comments*/ otherwise it probably would have broken.
.........................
Vassi no Diem et Tharin
<ramble/>

David Haley
Wizard






Group: Members
Posts: 6,913
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#125 id:14192 Posted Oct 20, 2008, 9:45 pm

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:
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

quixadhal
Wizard






Group: Members
Posts: 1,473
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#126 id:14214 Posted Oct 22, 2008, 12:57 am

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:
Code (text):
1
2
3
4
5
6
7
8
9
10
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.
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

Igabod
Wizard






Group: Members
Posts: 1,084
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#127 id:14215 Posted Oct 22, 2008, 1:12 am

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:
.........................
Every man has his follies, and often they are the most interesting thing he has got - Josh Billings
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein
I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger
Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan
I like long walks, especially when they are taken by people who annoy me. - Fred Allen

Sandi
Wizard






Group: Members
Posts: 628
Joined: Jun 17, 2006

Go to the bottom of the page Go to the top of the page
#128 id:14221 Posted Oct 22, 2008, 10:05 am

Thanks for all your effort, Quix.
.........................
The Witch of Tir na nOg

www.tnnmud.com
tnnmud.com 6789

Avaeryn
Conjurer






Group: Members
Posts: 113
Joined: Nov 21, 2007

Go to the bottom of the page Go to the top of the page
#129 id:14227 Posted Oct 22, 2008, 4:00 pm


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:

Conner
Wizard






Group: Members
Posts: 1,250
Joined: May 14, 2006

Go to the bottom of the page Go to the top of the page
#130 id:14231 Posted Oct 22, 2008, 4:22 pm

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:
.........................
                                              -=Conner=-

Administrator/Coder                                                      Primary SysOp
Land of Legends                                                            The Castle's Dungeon BBS
http://tcdbbs.zapto.org/mud/nwlightninglol1.jpg          http://tcdbbs.zapto.org/catapult1.gif                  http://thenethernet.com/images/about/joinme-180-short.png
telnet://tcdbbs.zapto.org:4000                                    telnet://tcdbbs.zapto.org:23

quixadhal
Wizard






Group: Members
Posts: 1,473
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#131 id:14232 Posted Oct 22, 2008, 4:23 pm

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

Seriously, you think I'm busy...
http://i302.photobucket.com/albums/nn96/quixadhal/busy_cat.png
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

Avaeryn
Conjurer






Group: Members
Posts: 113
Joined: Nov 21, 2007

Go to the bottom of the page Go to the top of the page
#132 id:14258 Posted Oct 22, 2008, 8:24 pm

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:

Conner
Wizard






Group: Members
Posts: 1,250
Joined: May 14, 2006

Go to the bottom of the page Go to the top of the page
#133 id:14274 Posted Oct 23, 2008, 4:40 pm

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:
.........................
                                              -=Conner=-

Administrator/Coder                                                      Primary SysOp
Land of Legends                                                            The Castle's Dungeon BBS
http://tcdbbs.zapto.org/mud/nwlightninglol1.jpg          http://tcdbbs.zapto.org/catapult1.gif                  http://thenethernet.com/images/about/joinme-180-short.png
telnet://tcdbbs.zapto.org:4000                                    telnet://tcdbbs.zapto.org:23

David Haley
Wizard






Group: Members
Posts: 6,913
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#134 id:14281 Posted Oct 23, 2008, 5:15 pm

I have to wonder if I'm missing a cultural reference w.r.t. "contact hyperactivity"... :smile:
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Avaeryn
Conjurer






Group: Members
Posts: 113
Joined: Nov 21, 2007

Go to the bottom of the page Go to the top of the page
#135 id:14284 Posted Oct 23, 2008, 6:08 pm


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:

Pages:<< prev ... 7, 8, 9, 10, 11 ... next >>
Tags
[+]

Valid XHTML 1.1! Valid CSS!