Almost Daily Contest Details

This is a discussion on Almost Daily Contest Details within the Contests Board forums, part of the Community Boards category; I had a great idea for something fun to do, but unfortunately, the beast that is the sig engine ruined ...

  1. #13
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I had a great idea for something fun to do, but unfortunately, the beast that is the sig engine ruined it for me. You see that line right above your sig? That was to be the top edge of a maze. So I wrote a maze generator, which gave me the following output:
    Code:
    |         |     |S
    | + +-+-+ + +-+ |I
    | | |       | | |G
    | + +-+-+-+-+ + |M
    | |     |   |   |A
    | +-+-+ + + + +-|Z
    |     |   | |   |E
    ------------------
    It would have lined up perfectly (on a character basis), and that line would have formed the top wall.

    However, it seems that:
    a) The sig doesn't preserve white space.
    b) The sig is in some obscure font.
    c) The line is in some obscure font and sice.
    d) The font tags have stopped working in the sig.
    e) Replacing the spaces with periods doesn't help, because characters aren't a fixed size in the sig.

    And so my idea was ruined. I was going to post the sig, and start a contest thread on it. Two contest actually:
    1) A basic contest to generate a maze to fit that line as the top of it.
    2) A harder contest to see if you could get the code for your maze generator to fit in the 500 character requirement for the sig space.

    My maze generator I made crunched down to some 900+ characters.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #define A char
    #define B break
    #define C case
    #define D if
    #define P printf
    #define I int
    I t(I y,I x,A m[4][8]){return((y<1?0:m[y-1][x]?0:1)+(x>6?0:m[y][x+1]?0:2)+(y>
    2?0:m[y+1][x]?0:4)+(x<1?0:m[y][x-1]?0:8));}void g(A m[4][8],I*u,I y,I x,I f){
    D(*u<31){I e,d;m[y][x]|=f;d=rand()%4;while((e=t(y,x,m))){switch(d++%4){C 0:D(e&1
    ){m[y][x]|=1;g(m,u,y-1,x,4);D(!t(y,x,m))B;}C 1:D(e&2){m[y][x]|=2;g(m,u,y,x+1,8)
    ;D(!t(y,x,m))B;}C 2:D(e&4){m[y][x]|=4;g(m,u,y+1,x,1);D(!t(y,x,m))B;}C 3:D(e&8){
    m[y][x]|=8;g(m,u,y,x-1,2);D(!t(y,x,m))B;}}}}}I main( void ){A s[4][8]={{0}},m[]
    ="SIGMAZE-";I u=0,y,x;srand((unsigned I)time(0));g(s,&u,rand()%4,rand()%8,0);for
    (y=0;y<4;y++){P("|");for(x=0;x<8;x++)P(!(s[y][x]&2)?" |":"  ");P("%c\n%c",m[y*2
    ],y<3?'|':'-');for(x=0;x<8;x++){P(!(s[y][x]&4)?"-":" ");P(y==3?"-":x==7?
    "|":"+");}P("%c\n",m[y*2+1]);}return 0;}
    I was going to see if I could rewrite it to fit in the required 500, but since the sig engine *CENSORED CENSORED CENSORED*, there's no point.

    So in short, it was a waste of time, amsuing though it was.

    [edit]
    Oooh. Another look at the code, and I've shaved off another 53 charactes.
    [edit]

    Quzah.
    Last edited by quzah; 09-15-2004 at 12:05 PM.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Almost Daily Contest Details
    By dagdarian in forum Contests Board
    Replies: 4
    Last Post: 01-25-2005, 04:03 AM
  2. Almost Daily Contest #4
    By Prelude in forum Contests Board
    Replies: 35
    Last Post: 08-25-2003, 08:54 AM
  3. Almost Daily Contest #3
    By Prelude in forum Contests Board
    Replies: 29
    Last Post: 08-16-2003, 08:48 PM
  4. Almost Daily Contest #2
    By Prelude in forum Contests Board
    Replies: 37
    Last Post: 08-09-2003, 10:51 PM
  5. Almost Daily Contest #1
    By Prelude in forum Contests Board
    Replies: 32
    Last Post: 08-05-2003, 08:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21