Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Roguelike in Haskell

Name: dddddddddddddddddddddddddd 2007-04-11 7:21 ID:Vgzv11QG

I'm making one ^_^

Just to show off my elite level building skillz

*Level> pLevel $ foldObjs emptyLevel [(Way True 10, 23, 14), (Way False 5, 23, 9) ,(Way True 5, 15, 4), (Room (15,12), 1, 1), (Room (10, 7), 19, 3), (Room (40,7), 32, 10)]
                                                                               
 ---------------                                                               
 |.............|                                                               
 |.............|   ----------                                                  
 |.............#####........|                                                  
 |.............|   |........|                                                  
 |.............|   |........|                                                  
 |.............|   |........|                                                  
 |.............|   |........|                                                  
 |.............|   ----#-----                                                  
 |.............|       #        ----------------------------------------       
 |.............|       #        |......................................|       
 ---------------       #        |......................................|       
                       #        |......................................|       
                       ##########......................................|       
                                |......................................|       
                                ----------------------------------------       
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
*Level>

Name: Anonymous 2007-04-20 17:29 ID:FkoSafTg

>>40
Yes, they go out then come back.

Name: Anonymous 2007-04-20 18:06 ID:TwvI+KHK

>>41

Idiot. We're talking about TOURING COMPLETENESS. A fundamental concept in computer science invented by Anal Touring.

Fuck your ducks.

Name: Anonymous 2007-04-20 18:32 ID:x0xFDaAH

>>42
Anal Touring sounds kinky.

Name: Anonymous 2007-04-20 19:06 ID:llPLX8Bt

>>43
Like something Alan Turing would have been into ...

Name: Anonymous 2007-04-20 19:25 ID:TwvI+KHK

>>44

True. He was homogeneous.

Name: Anonymous 2008-08-30 2:08

Xmonad

Name: Anonymous 2008-08-30 7:14

Please, for the love of god, add doors, people; otherwise, it is acceptable and even almost awesome that you are roguing in haskell.  Also, I'm sorry, but the # for walls (including corridor walls) is a terrible eyesore.  Please stop that.

Also, there is no penalty for diagonal movement (at least in nethack and many other roguelikes), and, in fact, diagonal movement is considered faster.

As someone hinted earlier, the nethack level generation code is available in mklev.c and mkmaze.c.  It's actually pretty straightforward (at least from what I can tell in a couple of minutes of looking at it).

mklev.c's meat is pretty much to make the rooms, then build doors between them and connect with corridors.  Here is the make rooms code:
STATIC_OVL void
makerooms()
{
    boolean tried_vault = FALSE;

    /* make rooms until satisfied */
    /* rnd_rect() will returns 0 if no more rects are available... */
    while(nroom < MAXNROFROOMS && rnd_rect()) {
        if(nroom >= (MAXNROFROOMS/6) && rn2(2) && !tried_vault) {
            tried_vault = TRUE;
            if (create_vault()) {
                vault_x = rooms[nroom].lx;
                vault_y = rooms[nroom].ly;
                rooms[nroom].hx = -1;
           
        } else
            if (!create_room(-1, -1, -1, -1, -1, -1, OROOM, -1))
            return;
    }
    return;
}

Name: Anonymous 2008-08-30 8:59

>>47
Door fan is butt-hurt.

Name: Anonymous 2008-08-30 9:33

old

Name: Anonymous 2008-08-30 9:35

Stupid fucking nomads.

Name: I hate doors 2008-08-30 12:40

>>47
I hate doors

Name: Anonymous 2010-11-14 9:46

Name: Anonymous 2010-11-27 5:50

Name: Anonymous 2010-11-28 0:49

Name: Anonymous 2010-12-17 1:34

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2010-12-21 14:42

Name: Anonymous 2011-02-02 23:00

Name: Sgt.Kabu柨kiman᤯衒 2012-05-29 0:07

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List