Posts for Bisqwit


Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I made a new WIP yesterday. I played in mode B. Used FCEUX. https://files.tasvideos.org/bisqwit/bisqwit-wwoodsv2-incompletev1.zip This goes 11 or 12 levels, I don't remember which. Oh... and why NES version, not SNES? A good question. Possibly because I'm not familiar with the SNES version… Nor am I comfortable with snes9x movie making.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Sticky wrote:
Heh, amazing what they could do with 32 different tones with a max of two at a time.
Yeah. Well, many modern instruments cannot even play that many different tones. A typical recorder for example, can only reach approximately one octave -- that is 12 tones, in student use. Even the best single-chambered ocarinas can produce a maximum of about 21 tones. With a maximum of one at a time.
Post subject: Re: Puzznic!
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
160 levels is quite long... For what I saw so far though, I'd say go ahead. We have Lolo and Tetris too, after all. Now I'm just waiting for someone to make a proper one of Wario's Woods.
Post subject: Interactive movies in Youtube
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
These are by no means "crappy". Interactive movies by a group calling themselves chad,matt&rob. http://www.youtube.com/watch?v=l8rJ1WML60Y&feature=channel The Time Machine: The Interactive Adventure! http://www.youtube.com/watch?v=BNGhSk_gamk The Murder: The Interactive Adventure! They've got some other stuff too. http://www.youtube.com/user/chadmattandrob
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
So this is the game where WRYYY comes from? Kazooie seems to be saying that all the time.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
moozooh wrote:
I believe it is done as a means of preserving disk space.
Actually, originally I meant it as a means to signal all distributers that a newer version of the movie is available, and that the old is now considered "obsolete". Nowadays I keep it for yes, disk space preserving reasons, and to dedicate the autoseeder's resources for better use.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Bisqwit wrote:
I've long been expecting someone to submit this movie. I look forward to watching it in full and setting it as a background on my work desktop. I think this movie should be published. It documents an important piece of classic game history, and I don't think there exists any other website that has a full movie of a roundtrip in this game, let alone 50 of them. However, for encoding, I think you may need to apply very, very customized encoding settings. In particular, extremely low bitrate for both audio and the video, but with high rate whenever something significant happens (such as the aforementioned bug splatting on the windscreen). Oh, and AVI is definitely out of question (the index alone would take 1.7 gigabytes), it must be MKV. For audio, I suggest a 1 kbit/s OGG for most of the movie with 50 kbit/s at key events; For video, I suggest x264 at quantizer 40 or something for most of the movie with quantizer 15 or so at key events. And naturally, reference frames, motion detection, frames types etc. at maximum.
I must say, I wasn't entirely joking when I wrote that post. On April Fools days, I like to say/do prepostrous things that stretch the limits on what people are ready to believe. Half truth, half lie, makes a good April Fools prank. Here, the ratio is about closer to 80% truth. So I hope that what happens here is the same as what happened to 8-bit neckties. (For those not in the know, the 8-bit necktie was originally an April Fools prank by ThinkGeek, but it turned into a real product due to high demand.)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Oh... I almost forgot to post this here. So this is me, finally realizing my dream of moving into some RPG world. Kindof. It's Final Fantasy VII. Doesn't seem to make too happy, though. I must find a better game!
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Ferret Warlord wrote:
Let me just get this out of the way... The emulator's name sounds like a headache prescription that includes "May cause high blood pressure" in the list of symptoms.
To me it sounds like a name of a Swedish―German language lesson book.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Moved your post here, to the existing thread. Check the previous three pages :)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Here's a 3D renderer a-la Wolfenstein (without textures):
1 DEFINT a-z    : REM Define the default type for all variables to be INT.
2 xm=8 : ym = 6 : REM maximum extents of the map we're prepared for.
3 DIM maze(xm,ym) : REM REM stands for "remark", i.e. a comment.
4 pi! = 3.141592653 : REM The "!" stands for explicitly FLOAT type variable.

10 REM Read the maze data.
11 y = 1
12 READ s$
20 IF s$ = "end" THEN 100
30 l=LEN(s$)
40 FOR x=1 TO l
50   IF MID$(s$, x, 1) = "1" THEN px!=x:py!=y:GOTO 70
60   IF MID$(s$, x, 1) = "X" THEN maze(x,y)=1
70 NEXT
80 y = y+1
90 GOTO 12

92 REM Maze data
93 DATA XXXXXXXX
94 DATA X   X  X
95 DATA X X XX X
96 DATA X      X
97 DATA X X1 XXX
98 DATA XXXXXXXX,end

100 SCREEN 1    : REM Set 320x200 quadcolor mode

102 DIM visible(xm,ym)
103 DIM renderlistx(xm*ym), renderlisty(xm*ym)
103 DIM floorlistx(xm*ym), floorlisty(xm*ym)

104 REM Center the observer in the tile he's standing on
105 px! = px!+0.5 : py! = py!+0.5

107 look! = 0.1 : REM Camera angle
108 sinlook! = SIN(look!)
109 coslook! = COS(look!)

110 REM With raycasting, figure out which walls stand in our view
111 FOR x=1 TO xm: FOR y=1 TO ym: visible(x,y)=0 : NEXT y,x
112 rendercount = 0 : floorcount = 0
113 CLS:KEY OFF:PRINT "Tracing..."
120 FOR angle! = pi!*-.5 TO pi!*.5 STEP pi!*(2/180)
130   REM Calculate the unit vector pointing to this direction.
131   REM Scale by 0.3 to ensure we're seeing everything we should.
140   xo!= SIN(angle! + look!) * 0.1
141   yo!=-COS(angle! + look!) * 0.1
150   distance = 0
160   REM Find an obstacle. Since we're in a closed maze, this loop is finite.
170   distance = distance + 1
171   xposint = INT(px! + distance * xo!) : REM INT truncates.
172   yposint = INT(py! + distance * yo!)
173   IF maze(xposint,yposint) > 0 THEN 180
174   IF visible(xposint,yposint) > 0 THEN 160 : REM Only add to floor-list once
175   visible(xposint,yposint) = distance
176   floorcount = floorcount + 1
177   floorlistx(floorcount) = xposint
178   floorlisty(floorcount) = yposint
179   GOTO 160
180   IF visible(xposint,yposint) > 0 THEN 190 : REM Only add to wall-list once
185   visible(xposint,yposint) = distance
186   rendercount = rendercount + 1
187   renderlistx(rendercount) = xposint
188   renderlisty(rendercount) = yposint
190 NEXT

195 CLS

220 REM Render each seen floor tile.
230 FOR wallno = 1 TO floorcount : GOSUB 900 : NEXT

240 REM Render each seen wall.
250 FOR wallno = 1 TO rendercount : GOSUB 300 : NEXT

260 REM IF INKEY$ = "" THEN GOTO 110 : REM loop
270 a$=INPUT$(1)
280 GOTO 9999 : REM end

300 REM Render the wall.
303 blockx=renderlistx(wallno)
304 blocky=renderlisty(wallno)

310 facecx!(0)=blockx   :facecy!(0)=blocky+.5 : REM west wall
311 facecx!(1)=blockx+ 1:facecy!(1)=blocky+.5 : REM east wall
312 facecx!(2)=blockx+.5:facecy!(2)=blocky    : REM north wall
313 facecx!(3)=blockx+.5:facecy!(3)=blocky+1  : REM south wall
314 FOR n=0 TO 3: GOSUB 700: NEXT : REM Draw walls.
399 RETURN

700 REM Draw a wall. Determine the two XY coordinates
701 REM that define the wall edges on the 2D map.
702 REM Note: We use the difference between INT and CINT on 0.5
703 REM value for benefit. 0.5 was previously used to indicate
704 REM a midpoint in a wall (lines 310-313). Neat trick.
710 cx! = facecx!(n) : x1! = INT(cx!) : x2! = CINT(cx!)
711 cy! = facecy!(n) : y1! = INT(cy!) : y2! = CINT(cy!)

720 REM Translate and rotate the coordinates around the player.
721 x! = x1!-px! : y! = y1!-py! : GOSUB 820 : x1! = x! : y1! = y!
722 x! = x2!-px! : y! = y2!-py! : GOSUB 820 : x2! = x! : y2! = y!

730 REM Put object somewhat front of the camera and apply a zoom to
731 REM avoid ugly distortions with lines that cross the camera plane
732 y1! = (-y1! + 2) * 0.5
733 y2! = (-y2! + 2) * 0.5

740 REM Calculate the screen coordinates. Start with X.
741 REM Y is determined by ceiling and floor....
742 x1 = 160  * (1 + x1! / y1!)
743 x2 = 160  * (1 + x2! / y2!)
744 y1c = 100 * (1 - 0.9 / y1!)
745 y2c = 100 * (1 - 0.9 / y2!)
746 y1f = 100 * (1 + 0.8 / y1!)
747 y2f = 100 * (1 + 0.8 / y2!)

750 REM Orient the wall.
751 IF x1 > x2 THEN SWAP x1,x2 : SWAP y1c,y2c: SWAP y1f,y2f

760 REM Render the wall.

766 REM Bound the loop
767 x = x1 : GOSUB 830 : x1b = x
768 x = x2 : GOSUB 830 : x2b = x

769 IF x1=x2 THEN 799 : REM Avoid division by zero in the loop

770 FOR x = x1b TO x2b
775  p! = (x-x1) / (x2-x1)
780  y2 = y1f + p! * (y2f-y1f)
781  y1 = y1c + p! * (y2c-y1c)

782  y1clip = y1: IF y1clip < 0 THEN y1clip = 0

785  IF POINT(x,y1clip) >= 2 THEN 795 : REM Poor man's zbuffer

788  IF x = x1 OR x = x2 THEN LINE(x,y1)-(x,y2),3:GOTO 795
789  PSET (x,y1),3 : PSET (x,y2),3
790  LINE (x,y1+1)-(x,y2-1),2
795 NEXT
799 RETURN : REM Done rendering that wall

800 REM This helper function calculates the distance of the wall.
801 a = facecx!(n) - px!
802 b = facecy!(n) - py!
803 facedist!(n) = a*a + b*b
804 RETURN

810 REM This helper function swaps the two wall specifications.
811 SWAP facedist!(a), facedist!(b)
812 SWAP facecx!(a), facecx!(b)
813 SWAP facecy!(a), facecy!(b)
814 RETURN

820 REM Rotate the coordinates to accommodate the camera's angle.
821 n! = x!
822 x! = n! * coslook! - y! * sinlook!
823 y! = n! * sinlook! + y! * coslook!
824 RETURN

830 REM Clipping horizontal coordinate to the screen range.
831 IF x < 0 THEN x=0
832 IF x > 319 THEN x=319
833 RETURN

900 REM Render the floor tile.
905 REM Get the tile coordinate, translate and rotate it around the player.
906 x! = floorlistx(wallno) + 0.5 - px!
907 y! = floorlisty(wallno) + 0.5 - py!
908 GOSUB 820
910 y! = (-y! + 2) * 0.5 : REM Fixup the z coordinate
915 REM Generate screen coordinates for the ceiling and the floor
920 x = 160 * (1 + x! / y!)
921 yc = 100 * (1 - 0.9 / y!)
922 yf = 100 * (1 + 0.8 / y!)

925 zs! = 2.5/y!

930 REM In the ceiling, draw a lighting device.
932 CIRCLE(x,yc),7*zs!, 1, ,, 0.1
935 CIRCLE(x,yc),2*zs!, 3

940 REM In the floor, draw a spot.
945 CIRCLE(x,yf),7*zs!, 1, ,, 0.1

999 RETURN


9999 SCREEN 0 : WIDTH 80,25 : REM Restore text mode
10000 END
10001 System error! Crash! Bing, bang!
10002 Funny fact: GW-BASIC is interpreted as it goes. That means you
10003 can include quite blatant syntax errors on any lines that are
10004 not executed, and it will do no harm whatsoever. Same goes for
10005 BAT files in DOS. However, you must still put a line number on
10006 each line, because otherwise the interpreter will complain about
10007 direct statements in the file.
9     PRINT "Reading map data..."
10008 Funny fact 2: Line numbers decide the order of program
10009 lines, not their location in the source code file.
100   PRINT "Done." : SCREEN 1 : CLS
10010 You can ever replace the previous content of the line
10011 by specifying the same line number twice.
Screenshot: Now, who can find the most annoying bug in it? (And who can build a game around it? :P ) Edit: Oh, and yes, I just wrote it, to refresh my GW-BASIC skills; I didn't pick it from archives ― back then, I couldn't even have programmed something like this.
Post subject: GW-BASIC fun (QuickBASIC too!)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Classic starfield effect!
10 SCREEN 1 
20 DEFINT a-z
20 n=30
30 DIM x(n), y(n), z(n), rx(n), ry(n)
100 LINE(0,0)-(319,199),0,BF
110 WHILE INKEY$ = ""
120   FOR a=1 TO n
130     PSET (rx(a),ry(a)),0
140     z(a) = z(a) - 50
150     IF z(a) >= 6 THEN 160
155     z(a) = 5000
156     x(a) = (RND-0.5)*9000
157     y(a) = (RND-0.5)*9000
160     rx(a) = INT(160+160!*x(a)/z(a))
170     ry(a) = INT(100+100!*y(a)/z(a))
175     IF rx(a) < 0 OR ry(a) < 0 OR rx(a) > 319 OR ry(a) > 199 THEN 155
180     PSET (rx(a),ry(a)), 4-z(a)/(5000!/3)
190   NEXT
200 WEND
210 SCREEN 0
220 WIDTH 80,25
Download DOSBox, download GW-BASIC [here], and run. (To run:
linux command: dosbox
dos command: mount c .
dos command: c:
dos command: gwbasic tmp.bas
in program: <any key to interrupt>
in gwbasic: system, to quit gwbasic
in gwbasic: load "tmp.bas", to reload the program
) Can anyone make this program perform faster?
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Solon wrote:
Aww, Google no longer tells you "Swim across the Atlantic Ocean" when you try to find directions between the US and Britain.
No... But if you want to get from Seattle to Sydney, it will tell you to kayak across the Pacific Ocean.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Okay, that seems horribly complicated. Oh the irony. Here's my code for UTF8 to UCS4 conversion:
#include <string>
#include <vector>

/* So much code for so little meaning. This is so called purity. */
class SeqResult
{
    bool     Bool;
    unsigned Length;
    unsigned Value;
    int ShiftType;
    
public:
    SeqResult(): Bool(false), Length(),Value(),ShiftType() { }
    SeqResult(bool v) : Bool(v), Length(),Value(),ShiftType() { }
    SeqResult(bool v, unsigned len) : Bool(v), Length(len), Value(),ShiftType() { }
    SeqResult(bool v, unsigned len, unsigned val) : Bool(v), Length(len), Value(val), ShiftType() { }
    SeqResult(int seq, unsigned len): Bool(true), Length(len), Value(), ShiftType(seq) { }
    
    operator bool() const { return Bool; }
    
    unsigned GetLength() const { return Length; }
    unsigned GetValue() const { return Value; }
    int GetShiftType() const { return ShiftType; }
    
    void SetBool(bool b) { Bool = b; }
    void SetLength(unsigned l) { Length = l; }
    void SetValue(unsigned n) { Value = n; }
    void SetShift(int s) { ShiftType = s; }
};

namespace UTF8
{
    void SeqValue(std::string& result, wchar_t ch, int&)
    {
        const unsigned n = ch;
        if(n < 0x80)                 // <=7 bits
            result += (char)n;
        else
        {
            if(n < 0x800)            // <11>>6));
            else
            {
                if(n < 0x10000)      // <16>>12));
                else                 // <21>>18));
                    result += (char)(0x80 + ((n>>12)&63));
                }
                result += (char)(0x80 + ((n>>6)&63));
            }
            result += (char)(0x80 + (n&63));
        }
    }

    const SeqResult IsData(const std::string& input, unsigned pos, int)
    {
        /* This must be the most obfuscated UTF-8 decoder I have seen.
         * I tried to avoid having many hardcoded magical numbers. -Bisqwit
         */
        unsigned char headbyte = input[pos];
        
        /* How many bytes does each sequence take? */
        static const char sizes[16] =
        { 1,1,1,1,1,1,1,1,   
          0,0,0,0,2,2,3,4 };
        
        /* What is the minimum value of the given sequence? */
        static const unsigned minimums[4] = { 0, 0x80, 0x800, 0x10000 };
        /* How to mask bits from the first byte */
        static const char     masks[4]    = { 0x7F, 0x1F, 0x0F, 0x07 };
        
        unsigned len = sizes[headbyte >> 4];
        
        //fprintf(stderr, "UTF-8 in: %c -> len=%u\n", (char)headbyte, len);
        
        /* Ensure it wasn't an invalid sequence */
        if(len == 0) return false;
        /* Ensure we have enough bytes */
        if(pos+len > input.size()) return false;
        
        unsigned result=0, shl=0;
        
        /* Process the tail bytes - last to first. */
        for(unsigned n = len; --n > 0; )
        {
            unsigned char byte = input[pos+n];
            
            //fprintf(stderr, "byte %u: %02X\n", n, byte);
            
            // The tail bytes must be 10xxxxxx
            if((byte & 0xC0) != 0x80) return false;
            
            unsigned bits = byte & 0x3F;
            result |= bits << shl;
            shl += 6;
        }
        
        /* Process the head byte. */
        // The top bits have already been verified in sizes[].
        // Take the low bits.
        unsigned bits = headbyte & masks[len-1];
        result |= bits << shl;
        
        if(result < minimums[len-1])
        {
            /* Non-optimal coding - not likely valid. */
            return false;
        }

        //fprintf(stderr, "UTF-8 in: %.*s -> %X\n", len, input.c_str()+pos, result);
        
        return SeqResult(true, len, result);
    }
}

void UTF8toUCS4(const std::string& input,
                std::vector<unsigned>& result)
{
    for(std::string::size_type pos = 0; pos < input.size(); )
    {
        SeqResult r = UTF8::IsData(input, pos, 0);
        if(r)
        {
            result.push_back(r.GetValue());
            pos += r.GetLength();
        }
        else
        {
            result.push_back('?');
            ++pos;
        }
    }
}

void UCS4toUTF8(const std::vector<unsigned>& input,
                std::string& result)
{
    for(std::string::size_type pos = 0; pos < input.size(); ++pos)
    {
        int shift;
        UTF8::SeqValue(result, input[pos], shift);
    }
}
I've got simpler code too, but this is very robust code that handles all kinds of error situations neatly and is suitably well commented.
Post subject: Re: Antispoiler forum tag?
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Xkeeper wrote:
I would recommend increasing the padding around the block of text (or perhaps giving it a slight border and making the background color slightly darker than a post) for readability reasons. Perhaps make it so if you click it, it stays in "visible" mode.
Feel free to extend upon this patch and provide to me. http://www.phpbb.com/community/viewtopic.php?t=366815
Post subject: Re: Antispoiler forum tag?
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Testing... It works! Thanks superyupikari :)
Post subject: Re: Antispoiler forum tag?
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Warp wrote:
I was thinking: How hard would it be to add support for a dedicated anti-spoiler tag to the forum posting format? This would simply automatically color the text with the same color as the background.
Not very hard I suppose. There might even be a dedicated phpbb patch for that somewhere. Find me one, I'll see if I can apply it.
Post subject: Re: C++ exercises
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Warp wrote:
But if you want to print unicode characters, don't you have to decide which encoding you are going to use to print them?
Yes (or not really, you can delegate that stuff to locale handling), but you don't need to encode them in any particular non-ascii way in the source code.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Rick wrote:
I have to admit, these variable avatars are really cool to mess around with. I think I spent a good three or four hours putting together all of mine. They're not quite mood-indicative, but it's kinda fun to have a new background behind my character there at the click of a button.
Nice. Now it seems that you are having those avatars hosted at Photobucked. Please take care that they don't turn without warning into something like this: For these are over the 100x100 allowed limit on this board.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Jungon wrote:
I'd vote NO, but I don't know where to vote yet, new here =P
Do note, dear lurker, that this movie was submitted (and rejected) over three years ago :)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I wrote this code. It is written in C++0x. You can compile it with e.g. Intel C++ Compiler by the following commandline: icc --std=c++0x bisqwitmaze.cc (Sorry, GCC does not support this syntax yet.)
#include <cstdio>
#include <cstdlib>
#include <wchar.h>
const int w=79, h=23;
static void draw(const wchar_t maze[w*h])
{
    for(int p=0; p<h; ++p)
        std::printf("%.*ls\n", w, maze+p*w);
}
static void gen(wchar_t maze[w*h])
{
    // Mark edges as walls and the interior as space
    for(int p=0; p<w*h; ++p)
        maze[p] = p%w==0||p%w==w-1  // vert walls at l&r
                ||p/w==0||p/w==h-1; // horiz walls at t&b
    // Populate the maze with maze walls
    for(int p=0; p<9999; ++p)
    {
        int r = std::rand(), x,y,x2,y2, hh=h/2, wh=w/2, l, hits=0, pos;
        if(std::rand()%2) // horiz wall
            l=4, // length
            y = y2 = 2*(r%(hh)+1), // an even row starting from 2
            x = 2*(r/(hh)%(wh+2-l)), // an even column
            x2 = x+l;
        else // vert wall
            l=2, // length
            x = x2 = 2*(r%(wh)+1), // an even column starting from 2
            y = 2*(r/(wh)%(hh+2-l)), // an even row
            y2 = y+l;
        // s is a scaling helper function
        auto s = [&pos,l] (int a,int b) { return a + (b-a)*pos/l; };
        for(pos=0; pos<=l; ++pos) hits += maze[s(y,y2)*w + s(x,x2)];
        if(hits != 1) continue; // must hit another wall in exactly 1 spot
        for(pos=0; pos<=l; ++pos) maze[s(y,y2)*w + s(x,x2)] = 1;
    }
    // e = helper function which tells whether the given char is not '\0' or space.
    //     space needs to be recognized due to the scanning order in the loop.
    auto e = [] (wchar_t c) { return c && c != L' '; };
    // Convert maze to text
    for(int y=0, p=0; y<h; ++y)
        for(int x=0; x<w; ++x,++p)
        {
            // Check neighbours (top,bottom,left,right)
            int t = y>0 && e(maze[p-w]), b = y<h-1 && e(maze[p+w]);
            int l = x>0 && e(maze[p-1]), r = x<w-1 && e(maze[p+1]);
            // Convert this spot to a character
            maze[p] =
              L" ~oI" // 0
             L")J\\+" // l
              L"(LF+" // r
              L"=+z+" // l+r
              // 0, t, b, t+b
              [maze[p]*(t + b*2 + l*4 + r*8)];
        }
}
int main()
{
    wchar_t maze[w*h];
    gen(maze);
    draw(maze);
}
It produces this output:
F=z===z=========z=z=z===z===z=z=z=z=========z=====z=====z===z=====z===z=====z=\
I I   I         I I I   I   I I I I         I     I     I   I     I   I     I I
I ~ o ~ (=====z=+ I I F=+=) ~ I ~ +=======) I F=z=+=z=) I (=+=\ o ~ (=+=\ o ~ I
I   I         I I I I I I     I   I         I I I I I   I   I I I       I I   I
I o +=z=z=z=\ I I ~ I I I F===J (=+=) o (===J I ~ ~ I (=+=) I ~ +=====z=+=+=\ I
I I I I I I I I I   I I I I       I   I       I     I       I   I     I     I I
+=+=J ~ I ~ ~ ~ I o ~ I I +===) (=+=z=+=\ o o ~ F===J (===\ ~ o ~ o o +===) ~ I
I       I       I I   I I I         I   I I I   I         I   I   I I I       I
I (=z=\ L===) o L=+=) ~ ~ L=z=\ F===J o ~ L=+===+=) (=====+=) I (=+=J ~ (=z=\ I
I   I I       I             I I I     I                   I   I   I       I I I
+=z=J L===\ o L=z=) F=======+ ~ ~ (===+ (=z=z=z=z===z===z=+=) I (=+=\ o o I ~ I
I I       I I   I   I       I         I   I I I I   I   I I   I     I I I I   I
I ~ o o o ~ I (=+=) ~ o o o ~ o F===) I o ~ ~ I ~ o ~ o ~ L===+=z===+=+=+=J o I
I   I I I   I   I     I I I   I I     I I     I   I   I         I       I   I I
+===+=+=+=z=J o +=====+=+=+===+=+ o o L=+=\ (=+=\ L===+===\ (=z=J (=z=) ~ o I I
I     I I I   I I     I I       I I I     I     I         I   I     I     I I I
+===) ~ ~ ~ o I ~ o o ~ L===) o +=+=+===\ I o o ~ (=======+===+ o F=+=) F=+=+ I
I           I I   I I         I I       I I I I               I I I     I   I I
I F===z=z===+=J (=+=J o o o o I ~ o (===+ L=+=+=z=\ o o o (===+=+=J F===J o ~ I
I I   I I         I   I I I I I   I     I     I I I I I I     I     I     I   I
+=+=) ~ ~ o F===) L=z=J I L=+=+ (=+=) o I (===+ ~ ~ I I I o (=+=) F=+=) o I o I
I         I I       I   I     I   I   I I     I     I I I I   I   I     I I I I
L=========+=+=======+===+=====+===+===+=+=====+=====+=+=+=+===+===+=====+=+=+=J
I present a number of challenges to the coding-savvy people: 3 points: Change the code to produce loops in the maze. 9 points: Change the code such that it compiles on compilers that do not support C++0x. 13 points: Change the code such that it uses Unicode line-drawing characters, block elements and other geometric shapes for a beautiful outcome. To get you started, the code is already written using the wchar_t type. You don't need to write utf-8 encoders and decoders. 1 point: Change the code such that it may produce locations on the map that are unreachable. 20 points: Complete the above task, and change the code to indicate the unreachable areas somehow (for example, by using "." instead of " " for those unreachable locations). 1 point: Change the code to produce two exits somewhere on the opposing edges of the maze. 15 points: Complete the above task, and change the code to indicate the longest solution path between the two exits (walking the same path twice is not allowed, though crossing the path is allowed). 24 points: Translate the code into LUA. In all of these tasks, particularly artistically written code and nice looking output may both give extra points. Lucky bugs or code that doesn't quite work may reduce your points. Send your solutions to me by a PM. Put the word "maze" somewhere in the message subject. Indicate which challenges you have solved, and which platforms you have compiled the program on. A copy of the solution's output is preferable. Multiple submissions by the same author are accepted; the latter submission overrides the earlier one. This challenge is open until 2009-04-20. I will try to maintain a leaderboard in this post. After the challenge closes, I will post some if not all of the source code submitted. The number of points awarded on each category is subject to change, but I will try to keep it fair. EDIT: Challenge is closed now. Here's a useful hint on C++0x.
Post subject: Re: Encouraging words
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Thanks for the feedback, r_schneider!
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Ferret Warlord wrote:
Alden, you never cease to amaze me. Please never stop ceasing to amaze me.
Your post contradicts itself. Please eschew stopping to cease not contradicting yourself like this.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
It is interesting that just with small graphics and sound effect changes this game could have just as well been a space shooter. Oh, and this movie desynced at me.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Wow! Aren't we a a little black & white. Some people rate this movie at 0, and some people rate it at 10. Nothing in between. I've long been expecting someone to submit this movie. I look forward to watching it in full and setting it as a background on my work desktop. I think this movie should be published. It documents an important piece of classic game history, and I don't think there exists any other website that has a full movie of a roundtrip in this game, let alone 50 of them. However, for encoding, I think you may need to apply very, very customized encoding settings. In particular, extremely low bitrate for both audio and the video, but with high rate whenever something significant happens (such as the aforementioned bug splatting on the windscreen). Oh, and AVI is definitely out of question (the index alone would take 1.7 gigabytes), it must be MKV. For audio, I suggest a 1 kbit/s OGG for most of the movie with 50 kbit/s at key events; For video, I suggest x264 at quantizer 40 or something for most of the movie with quantizer 15 or so at key events. And naturally, reference frames, motion detection, frames types etc. at maximum.