Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,90 @@
|
||||
char a[80];
|
||||
int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][1000];
|
||||
int main(char*d){
|
||||
return main((char*)(srand(time(&h)),
|
||||
setjmp(p[2]),
|
||||
(k=atoi((gets(a),
|
||||
a+strspn(a," -"))))
|
||||
&&(b=k),
|
||||
b||++b,
|
||||
j+=-j,
|
||||
d=(char*)(&j),
|
||||
setjmp(p[1]),
|
||||
1<<1>j&&(k&=4>>3,
|
||||
i=1<<k,
|
||||
h<<=i+j,
|
||||
setjmp(p[0]),
|
||||
(h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
|
||||
setjmp(p[3]),
|
||||
(i||!++i)&&(h--||(k|=i),
|
||||
i/=2,
|
||||
longjmp(p[3])),
|
||||
longjmp(p[0])),
|
||||
k^=-1,
|
||||
k+=1<<037,
|
||||
setjmp(p[3]),
|
||||
k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
|
||||
setjmp(p[0]),
|
||||
t+=(rand()>>3)%015-t,
|
||||
e[s]&(1<<t)&&longjmp(p[0]),
|
||||
e[s]|=1<<t,
|
||||
g[i]=t|++s<<"\004"["\004"[1]]|t),
|
||||
k>>=1,
|
||||
i+=1<<1,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
putchar(0x20+!putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13])),
|
||||
++k^005&&longjmp(p[0]),
|
||||
putchar('\n'),
|
||||
setjmp(p[3]),
|
||||
putchar(0x1F+!!putchar(("BCDHS"[g[--k]>>4]))),
|
||||
k&&longjmp(p[3]),
|
||||
putchar('\n'),
|
||||
j+=1<<0,
|
||||
1^j||(d=(char*)gets(a)),
|
||||
longjmp(p[1])),
|
||||
s=1==(f=0),
|
||||
i=0<<1,
|
||||
setjmp(p[3]),
|
||||
i<4&&(j=i+1,
|
||||
setjmp(p[1]),
|
||||
j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
|
||||
g[i]=g[j],
|
||||
g[j]=k),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
|
||||
setjmp(p[1]),
|
||||
--j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
|
||||
s+=3*!j|!(++i^17),
|
||||
(j*=i*=4)&&(i=1),
|
||||
setjmp(p[3]),
|
||||
5-j<2&&(j=0,
|
||||
setjmp(p[1]),
|
||||
5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]:(s+=((g[j]&0xf)>8&&f++,
|
||||
!!g[j]*i)),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
|
||||
s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
|
||||
s--,
|
||||
s*=b,
|
||||
printf("$%d (%d) \n",
|
||||
c+=s,
|
||||
s+b),
|
||||
i=0,
|
||||
setjmp(p[0]),
|
||||
6>i&&(j=1,
|
||||
setjmp(p[1]),
|
||||
0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
|
||||
--j,
|
||||
longjmp(p[1])),
|
||||
i+=++i,
|
||||
longjmp(p[0])),
|
||||
longjmp(p[2])));
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
Best Calculated Risk:
|
||||
|
||||
Brent Burley
|
||||
500 S. Buena Vista St.
|
||||
Burbank, CA 91521
|
||||
USA
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make burley
|
||||
|
||||
Try:
|
||||
|
||||
./burley
|
||||
|
||||
This is a draw poker program. You start with $100. Input alternates
|
||||
between your bet and which cards to keep. Example:
|
||||
|
||||
5 <== you enter a bet of $5 (defaults to $1)
|
||||
J Q J 9 5 <== your hand is Jack of Clubs, Queen of Hearts,
|
||||
C H D S C Jack of Diamonds, 9 of Spades, 5 of Clubs
|
||||
123 <== you enter which cards you want to keep
|
||||
(enter 0 to 5 digits between 1 and 5)
|
||||
J Q J J Q <== your new hand is Jack of Clubs, Queen of Hearts,
|
||||
C H D S C Jack of Diamonds, Jack of Spaces, Queen of clubs
|
||||
$145 (45) <== Your new balance is now $145. You had a Full House
|
||||
so your payoff is 9 times your bet == 45
|
||||
|
||||
The payout is according to "Vegas rules":
|
||||
|
||||
Straight Flush 50 times your bet
|
||||
Four of a Kind 25 times your bet
|
||||
Full House 9 times your bet
|
||||
Flush 6 times your bet
|
||||
Straight 4 times your bet
|
||||
3 of a Kind 3 times your bet
|
||||
2 Pair 2 times your bet
|
||||
Jacks or Better 1 times your bet
|
||||
|
||||
The program allows you to go into debt. However I'm sure you would
|
||||
never control-C kill the program just because you got behind, right?
|
||||
On the other hand the program never willingly exits, so you have
|
||||
to leave even when you are ahead. :-)
|
||||
|
||||
Can you figure out a winning betting "strategy"? Then can you modify
|
||||
the program so this "strategy" no longer works?
|
||||
|
||||
Notice the clever use of setjmp() and longjmp() calls. Can you keep
|
||||
track of what state is being saved and restored?
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This program plays draw poker. What is unusual about it is that it
|
||||
is written as a single statement -- count the semicolons! (OK, there
|
||||
are really three statements if you count the variable declarations.) To
|
||||
keep things simple, I have avoided the C preprocessor and tricky
|
||||
statements such as "if", "for", "do", "while", "switch", and "goto".
|
||||
@@ -0,0 +1,94 @@
|
||||
char a[80];
|
||||
int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][100];
|
||||
int main(char*d){
|
||||
return main((char*)(srand(time(&h)),
|
||||
setjmp(p[2]),
|
||||
(k=atoi((gets(a),
|
||||
a+strspn(a," -"))))
|
||||
&&(b=k),
|
||||
b||++b,
|
||||
j+=-j,
|
||||
d=(char*)(&j),
|
||||
setjmp(p[1]),
|
||||
1<<1>j&&(k&=4>>3,
|
||||
i=1<<k,
|
||||
h<<=i+j,
|
||||
setjmp(p[0]),
|
||||
(h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
|
||||
setjmp(p[3]),
|
||||
(i||!++i)&&(h--||(k|=i),
|
||||
i/=2,
|
||||
longjmp(p[3])),
|
||||
longjmp(p[0])),
|
||||
k^=-1,
|
||||
k+=1<<037,
|
||||
setjmp(p[3]),
|
||||
k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
|
||||
setjmp(p[0]),
|
||||
t+=(rand()>>3)%015-t,
|
||||
e[s]&(1<<t)&&longjmp(p[0]),
|
||||
e[s]|=1<<t,
|
||||
g[i]=t|++s<<"\004"["\004"[1]]|t),
|
||||
k>>=1,
|
||||
i+=1<<1,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
putchar(0x20,
|
||||
putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13],
|
||||
' ')),
|
||||
++k^005&&longjmp(p[0]),
|
||||
putchar('\n','\t'),
|
||||
setjmp(p[3]),
|
||||
putchar(0x20,
|
||||
putchar(("BCDHS"[g[--k]>>4]),
|
||||
'\n')),
|
||||
k&&longjmp(p[3]),
|
||||
putchar('\n','\t'),
|
||||
j+=1<<0,
|
||||
1^j||(d=(char*)gets(a)),
|
||||
longjmp(p[1])),
|
||||
s=1==(f=0),
|
||||
i=0<<1,
|
||||
setjmp(p[3]),
|
||||
i<4&&(j=i+1,
|
||||
setjmp(p[1]),
|
||||
j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
|
||||
g[i]=g[j],
|
||||
g[j]=k),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
|
||||
setjmp(p[1]),
|
||||
--j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
|
||||
s+=3*!j|!(++i^17),
|
||||
(j*=i*=4)&&(i=1),
|
||||
setjmp(p[3]),
|
||||
5-j<2&&(j=0,
|
||||
setjmp(p[1]),
|
||||
5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]:(s+=((g[j]&0xf)>8&&f++,
|
||||
!!g[j]*i)),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
|
||||
s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
|
||||
s--,
|
||||
s*=b,
|
||||
printf("$%d (%d) \n",
|
||||
c+=s,
|
||||
s+b),
|
||||
i=0,
|
||||
setjmp(p[0]),
|
||||
6>i&&(j=1,
|
||||
setjmp(p[1]),
|
||||
0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
|
||||
--j,
|
||||
longjmp(p[1])),
|
||||
i+=++i,
|
||||
longjmp(p[0])),
|
||||
longjmp(p[2])));
|
||||
}
|
||||
Reference in new issue
Block a user