Add tbo obfuscated C tom bombem

This commit is contained in:
Vince Weaver 2012-12-18 21:45:09 -05:00
parent a3f4fd0683
commit 89efbb96c3
10 changed files with 2236 additions and 0 deletions

237
tbo/.tbo-clear.c Normal file
View File

@ -0,0 +1,237 @@
/* todo, make look like game */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h> /* usleep */
#include <termios.h>
#include <fcntl.h>
char ch;
static int ri;
/* pseudo-random generator */
int int_random(int seed) {
if (seed!=0) {
ri=seed;
while ((ri%2==0) || (ri%5==0)) ri++;
ri=ri&0xffffff;
return ri;
}
ri*=997;
ri&=0xffffff;
return ri>>4;
}
/* clear the screen */
void cls() {
printf("%c[2J%c[H\n",27,27);
}
/* display help */
void help() {
cls();
printf("HELP\n");
printf("~~~~\n");
printf(", moves left\n");
printf(". moves right\n");
printf("spacebar shoots\n");
printf("s toggles sound\n");
printf("p pauses\n");
printf("q quits\n");
while(read(0,&ch,1)<0);
}
int main(int argc, char **argv) {
FILE *debug;
char j,x=7,keypressed;
int i,s=0,sh=5,ra,wait,frames=0,shots=0,sound=1,xb=0,done=0;
short missile[8],enemy[8],stars[8],mask;
for(i=0;i<8;i++) enemy[i]=missile[i]=stars[i]=0;
static struct termios new_tty,old_tty;
debug=fopen("bob","w");
/* Setup Term */
tcgetattr(0,&old_tty);
new_tty=old_tty;
new_tty.c_lflag&=~ICANON;
new_tty.c_cc[VMIN]=1;
new_tty.c_lflag&=~ECHO;
tcsetattr(0,TCSANOW,&new_tty);
fcntl(0,F_SETFL,fcntl(0,F_GETFL) | O_NONBLOCK);
cls();
/* do the opening */
i=8;
while(i>0) {
cls();
for(j=0;j<i;j++) printf("\n");
if(j<7) printf(" TOM BOMBEM\n");
if(j<6) printf(" OBFUSCATED\n");
if(j<5) printf(" by\n");
if(j<4) printf(" vmw5@cornell\n");
if(j<3) printf("\n");
if (j<2) printf(" h for help\n");
i--;
usleep(300000);
}
while(read(0,&ch,1)<0);
if (ch=='h') help();
ch=0;
wait=(int_random(255)&0xf);
while(!done) {
frames++;
ra=int_random(0);
/* If wait time up, put a new enemy */
if (!wait) {
enemy[0]|=1<<( (int_random(0)&0xf));
wait=(int_random(0)&0xf);
/* Go a bit faster the more points you get */
wait-=(s/15);
if (wait<1) wait=1;
}
else wait--;
/* check the keyboard */
keypressed=read(0,&ch,1);
if (keypressed) {
if (ch=='q') done=1;
if (ch==',') x--;
if (ch=='.') x++;
if (ch=='h') help();
if (ch=='s') sound=!sound;
if (ch=='p') {
while(read(0,&ch,1)<0);
ch=0;
}
if (ch==' ') {
missile[7]|=(1<<(x+1));
shots++;
ri+=frames;
}
/* Handle arrow keys */
if (ch=='\033') {
read(0,&ch,1);
if (ch=='[')
{
read(0,&ch,1);
if (ch=='D') x--;
if (ch=='C') x++;
}
}
if (x<1) x=1;
if (x>13) x=13;
ch=0;
}
/* draw the action */
cls();
for(i=0;i<8;i++) {
for(j=0;j<16;j++) {
mask=1<<j;
if ((missile[i]&mask) && (enemy[i]&mask))
{
printf("*");
missile[i]&=~mask;
enemy[i]&=~mask;
s++;
if ((s&31)==0) sh++;
}
else
if (missile[i]&mask) printf("!");
else
if (enemy[i]&mask) printf("T");
else if (stars[i]&mask) printf(".");
else printf(" ");
}
printf("\n");
}
printf("%c[%iC/#\\\n",27,x);
printf("SCORE: %i\n",s);
printf("SHIELDS: %i\n",sh);
/* collision detect with ship */
mask=0x7<<(x);
if (enemy[7]&mask) {
sh--;
if (sh<0) {
done=1;
}
if (sh==0) {
xb=5;
}
if (sound) printf("%c",7);
enemy[7]&=~mask;
}
/* Scroll the stars */
if ((frames&0x7)==1) {
for(i=7;i>0;i--) stars[i]=stars[i-1];
stars[0]=1<<(int_random(0)&0xf);
}
/* scroll the missiles */
if (frames&1) {
for(i=0;i<7;i++) missile[i]=missile[i+1];
missile[7]=0;
}
/* scroll the enemies */
if ((frames&0x3)==2) {
for(i=7;i>0;i--) enemy[i]=enemy[i-1];
enemy[0]=0;
}
/* delay */
usleep(33000);
/* extra beep */
if (xb) {
xb--;
if (xb==0)
if (sound) printf("%c\n",7);
}
}
/* end screen */
cls();
printf("\n\n\nGAME OVER!\n");
printf("SCORE: %i\n",s);
if (!shots) printf("HIT RATIO: %i%%\n",
s*100/shots);
return 0;
}

10
tbo/Makefile Normal file
View File

@ -0,0 +1,10 @@
CC = cc
CFLAGS = -O2 -Wall
all: tbo
tbo: tbo.c
$(CC) $(CFLAGS) -o tbo tbo.c
clean:
rm -f *~ *.o tbo

121
tbo/README Normal file
View File

@ -0,0 +1,121 @@
Tom Bombem: Obfuscated!
~~~~~~~~~~~~~~~~~~~~~~~
by Vince Weaver <vince@deater.net>
http://www.deater.net/weave/
"Homework is the mother of procrastination."
COMPILING/RUNNING:
~~~~~~~~~~~~~~~~~~
gcc -ansi tbo.c -O2 -o tbo
Has been tested on x86 FreeBSD, x86 Linux, PPC Linux, and Tru64 Alpha.
Needs at least VT102 emulated terminal support.
Should run in Color on color xterm or ansi-color (Linux) terminals.
Runs fine in all X-terms tested. Unfortunately has high flicker-rate on
unaccelerated Linux framebuffer console (but runs fine on stock text console).
NEAT THINGS:
~~~~~~~~~~~~
The C code is designed to look like a box-cover if this game were
commercially sold at a store.
BACKGROUND:
~~~~~~~~~~~
The Tom Bombem series of games [http://www.deater.net/weave/vmwprod/tb1/]
are scrolling space-shooters that I've written over the years. From
Turbo-Pascal in DOS, to SDL under Linux, to an 8k-text-mode-hand-assembled
-Linux-x86 binary, to a 4k Apple IIe 6502 game.
But now he reaches the final frontier: Obfuscation!
STORY:
~~~~~~
You are Tom Bombem, guardian of Earth! One day you are on routine patrol
in your crudely rendered spaceship when evil objects shaped like T's start
attacking! Destroy as many as you can to save the day!
GAMEPLAY:
~~~~~~~~~
Use , and . [or the arrow keys if you have a proper terminal emulator]
to steer. The spacebar shoots.
The game gradually gets harder the higher your score is. Every 30 points
or so your shields will increase.
OBFUSCATIONS:
~~~~~~~~~~~~~
This was a hard program to obfuscate.
Some of the obfuscations done:
* Pseudo random number generator [actually a very horrible one]
* All collision detection and "sprite" drawing done entirely with
bitwise operations. While a bit convoluted looking it was much easier
to get right than typical collision detection routines.
* the text strings are all more-or-less rot-4 encoded just to make
things less obvious
* Made all variable and function names single characters.
* Removed as many parenthesis as operator precedence would allow.
* Random other obfuscations as was prudent.
* Arranged into the screen-shot format.
Common Complaints:
~~~~~~~~~~~~~~~~~~
Complaint: I can't shoot things in the right-most column!
Response: That is by design. Otherwise a wall-hugging strategy makes
the game trivially easy.
Complaint: What are those ugly dots falling from above?
Response: Stars scrolling by! You are either moving really quickly,
or else you are just looping in a big circle.
Complaint: I miss the typical "Tom Bombem" sliding ship motion
[ie pressing left starts your ship moving left, not
moving a discrete distance like this game].
Response: I can't make everyone happy! Usually people complain
that I _do_ have the sliding motion. Only being 16
chars wide it should be OK the way things are, though
your keyboard might get a workout.
Personal High Score
~~~~~~~~~~~~~~~~~~~
(after not much trying, really)
SCORE: 185
HIT RATIO: 46%
Special Thanks to:
~~~~~~~~~~~~~~~~~~
KRG
--
vmw
27 February 2004
--
/* Vince Weaver vince@deater.net vmw5@cornell www.deater.net/weave */
main(){char O,o[66]="|\n\\/_ ",*I=o+7,l[]="B!FhhBHCWE9C?cJFKET$+h'Iq*chT"
,i=0,_;while(_=l[i++])for(O=0;O++<_>>5;)*I=*(I++-(_&31));*I=0;puts(o+5);}

1
tbo/build Normal file
View File

@ -0,0 +1 @@
gcc -ansi prog.c -O2 -o prog

198
tbo/ioccc.entry Normal file
View File

@ -0,0 +1,198 @@
---entry---
rule: 2004
fix: y
title: vmw5
entry: 0
date: Sat Feb 28 02:05:50 2004
host: Linux x86, Linux PPC, FreeBSD x86, Tru64 Alpha, Linux x86_64
---remark---
Be sure to run in a window with VT-102 or equivelant terminal emulation.
The c code is its own promotional literature.
---author---
name: Vince Weaver
org: VMW Software Productions
addr: 190 Pleasant Grove Rd. Apt H2
Ithaca, NY 14850
USA
email: vince@deater.net
url: http://www.deater.net/weave/
anon: n
---info---
begin 444 README
M5&]M($)O;6)E;3H@3V)F=7-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N8V4@5V5A=F5R("!V:6YC94!D96%T97(N;F5T("!V;7<U0&-O
M<FYE;&P@('=W=RYD96%T97(N;F5T+W=E879E("`J+PH*;6%I;B@I>V-H87(@
M3RQO6S8V73TB?%QN7%PO7R`@(BPJ23UO*S<L;%M=/2)"(49H:$)(0U=%.4,_
M8TI&2T54)"MH)TEQ*F-H5"(*+&D],"Q?.W=H:6QE*%\];%MI*RM=*69O<BA/
M/3`[3RLK/%\^/C4[*2I)/2HH22LK+2A?)C,Q*2D[*DD],#MP=71S*&\K-2D[
#?0H*
`
end
---build---
begin 444 build
=9V-C("UA;G-I('!R;V<N8R`M3S(@+6\@<')O9PH`
`
end
---program---
begin 444 prog.c
M(VEN8VQU9&4@/'-T9&EO+F@^"B-I;F-L=61E(#QU;FES=&0N:#X*(VEN8VQU
M9&4@/'1E<FUI;W,N:#X*(VEN8VQU9&4@/&9C;G1L+F@^"B-D969I;F4@<"!P
M=71C:&%R"@H)"2`@("`@8VAA<B!W6UT](C1?-DXT7TP@6%-1)$93449)42!3
M1DHB"@D)("`@("`B65='15A)2"!F?2!Z<7LY1&=S=G)I<'`@;"1J<W8D;"(*
M"0D@("`@(")I<'0@+BXN(#,G8"`U5T=35DD^)"0D(#573$U)4$A7(@H)"2`@
M("`@(CXD(#4U-4M%44DD4UI)5B4@-4Q-6"1615A-4SXD(#0B"@D)("`@("`@
M("`@("`@("`@(E\@3$E05#5!04%!(@H)"0D@("`@("`@(C4P)'%S>FEW)'!I
M(@H)"0D@("`@("`@(FIX-3(D<7-Z:7<D(@H)"0D@("`@("`@(G9M:VQX-7=T
M96=I(@H)"0D@("`@("`@(F9E=B1W;'-S>'<U(@H)"0D@("`@("`@(G<D>'-K
M:W!I=R1W(@H)"0D@("`@("`@(G-Y<F@U="1T97EW(@H)"0D@("`@("`@(FEW
M-74D=7EM>'<B+"`@"@H*"@H*"0D)("`@("`@(%\L*D\[:6YT(&DL<ST*"0D)
M("`@("`@(#`L2#TU+%0L1CTP+%H*"0D)("`@("`@(#TP+$X],2Q8/3`L13T*
M"0D)("`@("`@(#`L>#TW+%9;.%TL35L*"0D)("`@("`@("`@.%TL5ULX72QM
M"@D)"2`@("`@("`@("QA.VEN="!R*`H)"0D@("`@("`@("!I;G0@<RE[:68*
M"0D)("`@("`@("`@("AS*6$]<SL*"0D)("`@("`@("`@('=H:6QE*"$*"@D)
M"2`@("`@("`@("`H828Q)B9A"@D)"2`@("`@("`@("`E-2DI82LK"@D)"2`@
M("`@("`@("`[82H].3DW"@H*"@H@("`@("`@("`@("`@("`@("`@("`@("`[
M828],'AF9F9F9F8[<F5T=7)N(#$U)F$^/@H@("`@("`@("`@("`@("`@("`@
M("`@("`T.WUV;VED(%`H:6YT('@I>W!U=',H=RMX*0H@("`@("`@("`@("`@
M("`@("`@("`@("`[?6EN="!'*"E[<F5T=7)N(')E860H,"PF7PH@("`@("`@
M("`@("`@("`@("`@("`@("`L,2D[?79O:60@62@I>W=H:6QE*$<H*3PP*0H@
M("`@("`@("`@("`@("`@("`@("`@("`[?2`@=F]I9"!)*&EN="!Y+&EN="!X
M*2`@>PH@("`@("`@("`@("`@("`@("`@("`@("!P<FEN=&8H(B5S)60B+'<K
M>2QX*3M]=F]I9"`*("`@("`@("`@("`@("`@("`@("`@("`@42AI;G0@>"E[
M22@Q,30L>"\Q,#`I.W`H-C<*("`@("`@("`@("`@("`@("`@("`@("`@*3M0
M*'@E,3`P*3M]=F]I9"!"*&EN="!C*7L*("`@("`@("`@("`@("`@("`@("`@
M("`@<')I;G1F*")<,#,S6R5D.R5D.S0P;2(L8SX*("`@("`@("`@("`@("`@
M("`@("`@("`@,S<L8R8V,RD[?7-T<G5C="!T97)M:6]S(&\*("`@("`@("`@
M("`@("`@("`@("`@("QN.W9O:60@8BAI;G0@=RQI;G0@8RE[0BAC*3MP*`H@
M("`@("`@("`@("`@("`@("`@('<I.T(@*"<E)RD[?6EN="!M86EN*"E[3SUW
M.V1O(&EF*"H*("`@("`@("`@("`@("`@("`@3ST],S(I("I/(#T@,#L@96QS
M92!I9B`H*D\]/34R*2`J3STR-SL*("`@("`@("`@("`@("`@(&5L<V4@:68H
M("I//3TU,RDJ3STQ,#ME;'-E("I/+3TT.R!W:&EL92@J*RL*("`@("`@("`@
M("`@("!/*3MT8V=E=&%T='(H,"PF;RD[=&-G971A='1R*#`L)FXI.R!N+F-?
M;&9L86<F/0H@("`@("`@("`@("!^24-!3D]..VXN8U]C8UM634E.73TQ.VXN
M8U]L9FQA9R8]?D5#2$\[=&-S971A='1R*`H@("`@("`@("`@,"Q40U-!3D]7
M+"9N*3L@(&9C;G1L("@P+"!&7U-%5$9,+&9C;G1L("`H,"P@1E]'151&3"E\
M"B`@("`@("`@3U].3TY"3$]#2RD@.R!"*"`G)2<I.V9O<BAI/3`[:3PX.VDK
M*RE66VD@73T@32!;:5T]5UMI73TP.PH@("`@("!W:&EL92`H:2E[4"@P*3MF
M;W(@*&T],#MM/&D[;2LK*5`H-RD[:68H;3PW("E1*#,P."D[:68@*&T\-BE1
M*`H@("`@,S$Y*3MI9BAM/#4I42@W,S`I.R`@:68H;3PT*5$H,C,S*3MI9BAM
M/#,I4"@W("`I.VEF*&T\,BE1*#,T-BD[:2TM"B`@.W5S;&5E<"@S,#`P,#`I
M.WU9*"D[5"`]<B@R-34I.W=H:6QE*"%%*7M"*"<E)RD[($8K*SMI9B@A5"E[
M*DU\/3$\/'(H,`H@("`@("`@("`@("`@("`@("`@("`@("`@("`I.U0]<B@P
M*2US+S$U.VEF*%0\,0H@("`@("`@("`@("`@("`@("`@("`@("`@*50],3M]
M96QS92!4+2T[:68H1R@I*7MI9@H@("`@("`@("`@("`@("`@("`@("`@("A?
M/3TQ,3,I13TQ.VEF*%\]/30T*7@M+3MI9BA?"B`@("`@("`@("`@("`@("`@
M("`@("`@("`]/30V*7@K*R`@.VEF("`H7ST],3`T*7M0"B`@("`@("`@("`@
M("`@("`@("`@("`@("@P*2`@.U`H("`@,3$W*3L@("!9*"D[?0H@("`@("`@
M("`@("`@("`@("`@("`@(&EF("`@("A?("`@("`@(#T]("`@(#$Q-2D*("`@
M("`@("`@("`@("`@("`@("`@("`@3B`@("`@/2$@("`@($X[("`@(&EF("`H
M7PH@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@/3T*"@H*("`@("`Q
M,3(I>UDH*3L@("`@7STP.WUI9BA?/3T@("`S,BE[5ELW77P],2`@("`@/#PH
M>"LQ*3M:("`@*RL[82L]1CM]"B`@("!I9BA?("`@("`@("`@/3TR-R`@("`@
M("`@("`I>T<@("`@("`@*"D[("`@(&EF*"`@("!?/3T@(#DQ*0H@("`@>T<H
M*2`@("`@("`@(#MI9B@@("`@("`@("`@7ST]("`@("`@(#8X*2`@("!X+2T@
M("`@.VEF("`H(%\*("`@("`]/38W*7@K*SL@("!]?6EF("`@("`@("`@("AX
M/"`@("`@("`Q*7@@("`@*RL[:68H>#X@("`@,3,I>"TM.U\*("`@("`@("`@
M("`],#M]("!0*#`I("`@("`@("`@(#MF;W(@("`@("`H:3T@("`@,#MI(#PX
M.VD@("`@*RLI"B`@("`@("`@("`@>V9O<B`@*&T],3L@("`@("`@("!M/#$\
M/"`@("`Q-CMM("`@(#P\/2`@(#$I>R`@(&EF*`H@("`@*%9;:5TF;2DF*"`@
M("!-6VE=)FTI*7MB*"`@(#0R+"=?)RD[5EMI("`@("!=)CT@("`@?FT[("!-
M6VE=)CU^;3L*"@H@:68H(2@K*W,F("`@,S$I("`@*2!(("`@*RL[?2`@96QS
M92!I9B@@(%9;:2`@("`@("`@729M*6(@("`@("`@*#,S+"=A)RD["F5L<V4@
M("`@("`@("!I9B@@("!-6VD@("`@728@("!M*6(@("`@("`@*#@T("`@("`@
M("`L)V`G("D[("`@(&5L<V4@("`@("`@(`II9BA7("`@("`@("`@6VE=("`@
M)FTI("`@('`H("`@-#8I.R`@("`@(&5L<V4@("`@("`@<"@@("`S,BD@("`[
M?7`*("@W,RD[4"@W*2`@(#M];3TW/#QX.R`@("!I9B`@("A-6S==)FTI("![
M:68H("`@("`@("TM("`@($@\,"D@($4],3MI9B@A"B`@("`@("`@2"E8("`]
M-3L@("!I9B@@("`@3BD@("!P*#<@("`@("`@*3M-6R`@("`@("`W72`@("`@
M)CU^("`@("`@("!M.T(*("`@("`@("@G7R<@("D[42`@("AX*B`@(#$P,"`@
M("LU-R`@("`@("`I.T(H("`@("`@("<E)R`@("D[?2`@("`@("`@96QS90I[
M0B@G92<I.U$H("`@>"`J("`@,3`P("`K-C$I.R`@0B@G)2<I.WT@($DH-C8L
M<RD[22`@*#<V+$@I.W`@("`@*#$P*3MI9B@*"@H*"B`@("`@("`@("`@("`@
M("$H1B8W*2E[9F]R*&D@(#TW.VD^,#MI+2TI5UMI("!=/5=;:2TQ73LJ5STQ
M/#P*("`@("`@("`@("`@("`@('(H,"D[?6EF*$8F("`@(#$I>V9O<BAI/3`[
M:2`@("`\-SMI*RLI5EMI73U6"B`@("`@("`@("`@("`@("`@6VDK,5T[5ELW
M("`@("`@73TP.WUI9B@A*"`@("`@($8F,RDI>V9O<BAI"B`@("`@("`@("`@
M("`@("`@(#TW.VD^,#L@("`@("`@(&DM+2E-6VE=("`@("`@("`]35MI+3%=
M.RH*("`@("`@("`@("`@("`@("`@($T],#M]("`@("`@("`@('5S;&5E<"`@
M("`@("`@("`H,S,P,#`I"B`@("`@("`@("`@("`@("`@("`@.VEF("`@("`@
M("`@("`@*%@I>R`@("`@("`@("`@(&EF("@A"B`@("`@("`@("`@("`@("`@
M("`@+2T@("`@("`@("`@("`@(%@]/2`@("`@("`@("`@("`P*6EF"B`@("`@
M("`@("`@("`@("`@("`@("@@("`@("`@("`@("`@("!.("`@("`@("`@("`@
M("`@*7`*"B`@("`@("`@("`@("`@("`@("`@*#<I.WU]4"@P*3M0*#@X*3M)
M*#8U+',I.VEF*%HI22@Q,#$*("`@("`@("`@("`@("`@("`@("`L<RH@("`@
M,3`P+UHI.W`H,S<I.W`H,3`I.W`@("`@*#$P*0H@("`@("`@("`@("`@("`@
H("`@(#MT8W-E=&%T='(H,"Q40U-!3D]7+"9O*3MR971U<FX@,#M]"@``
`
end
---end---

1302
tbo/mkentry.c Normal file

File diff suppressed because it is too large Load Diff

1
tbo/prog.c Symbolic link
View File

@ -0,0 +1 @@
tbo.c

2
tbo/remarks Normal file
View File

@ -0,0 +1,2 @@
Be sure to run in a window with VT-102 or equivelant terminal emulation.
The c code is its own promotional literature.

104
tbo/tbo.c Normal file
View File

@ -0,0 +1,104 @@
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#define p putchar
char w[]="4_6N4_L XSQ$FSQFIQ SFJ"
"YWGEXIH f} zq{9Dgsvripp l$jsv$l"
"ipt ... 3'` 5WGSVI>$$$ 5WLMIPHW"
">$ 555KEQI$SZIV% 5LMX$VEXMS>$ 4"
"_ LIPT5AAAA"
"50$qsziw$pi"
"jx52$qsziw$"
"vmklx5wtegi"
"fev$wlssxw5"
"w$xskkpiw$w"
"syrh5t$teyw"
"iw5u$uymxw",
_,*O;int i,s=
0,H=5,T,F=0,Z
=0,N=1,X=0,E=
0,x=7,V[8],M[
8],W[8],m
,a;int r(
int s){if
(s)a=s;
while(!
(a&1&&a
%5))a++
;a*=997
;a&=0xffffff;return 15&a>>
4;}void P(int x){puts(w+x)
;}int G(){return read(0,&_
,1);}void Y(){while(G()<0)
;} void I(int y,int x) {
printf("%s%d",w+y,x);}void
Q(int x){I(114,x/100);p(67
);P(x%100);}void B(int c){
printf("\033[%d;%d;40m",c>
37,c&63);}struct termios o
,n;void b(int w,int c){B(c);p(
w);B ('%');}int main(){O=w;do if(*
O==32) *O = 0; else if (*O==52) *O=27;
else if( *O==53)*O=10;else *O-=4; while(*++
O);tcgetattr(0,&o);tcgetattr(0,&n); n.c_lflag&=
~ICANON;n.c_cc[VMIN]=1;n.c_lflag&=~ECHO;tcsetattr(
0,TCSANOW,&n); fcntl (0, F_SETFL,fcntl (0, F_GETFL)|
O_NONBLOCK) ; B( '%');for(i=0;i<8;i++)V[i ]= M [i]=W[i]=0;
while (i){P(0);for (m=0;m<i;m++)P(7);if(m<7 )Q(308);if (m<6)Q(
319);if(m<5)Q(730); if(m<4)Q(233);if(m<3)P(7 );if(m<2)Q(346);i--
;usleep(300000);}Y();T =r(255);while(!E){B('%'); F++;if(!T){*M|=1<<r(0
);T=r(0)-s/15;if(T<1
)T=1;}else T--;if(G()){if
(_==113)E=1;if(_==44)x--;if(_
==46)x++ ;if (_==104){P
(0) ;P( 117); Y();}
if (_ == 115)
N =! N; if (_
==
112){Y(); _=0;}if(_== 32){V[7]|=1 <<(x+1);Z ++;a+=F;}
if(_ ==27 ){G (); if( _== 91)
{G() ;if( _== 68) x-- ;if ( _
==67)x++; }}if (x< 1)x ++;if(x> 13)x--;_
=0;} P(0) ;for (i= 0;i <8;i ++)
{for (m=1; m<1<< 16;m <<= 1){ if(
(V[i]&m)&( M[i]&m)){b( 42,'_');V[i ]&= ~m; M[i]&=~m;
if(!(++s& 31) ) H ++;} else if( V[i ]&m)b (33,'a');
else if( M[i ]& m)b (84 ,'`' ); else
if(W [i] &m) p( 46); else p( 32) ;}p
(73);P(7) ;}m=7<<x; if (M[7]&m) {if( -- H<0) E=1;if(!
H)X =5; if( N) p(7 );M[ 7] &=~ m;B
('_' );Q (x* 100 +57 );B( '%' );} else
{B('e');Q( x * 100 +61); B('%');} I(66,s);I (76,H);p (10);if(
!(F&7)){for(i =7;i>0;i--)W[i ]=W[i-1];*W=1<<
r(0);}if(F& 1){for(i=0;i <7;i++)V[i]=V
[i+1];V[7 ]=0;}if(!( F&3)){for(i
=7;i>0; i--)M[i] =M[i-1];*
M=0;} usleep (33000)
;if (X){ if (!
-- X== 0)if
( N )p
(7);}}P(0);P(88);I(65,s);if(Z)I(101
,s* 100/Z);p(37);p(10);p (10)
;tcsetattr(0,TCSANOW,&o);return 0;}

260
tbo/undone.c Normal file
View File

@ -0,0 +1,260 @@
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#define p putchar
char w[] = "4_6N4_L XSQ$FSQFIQ SFJ"
"YWGEXIH f} zq{9Dgsvripp l$jsv$l"
"ipt ... 3'` 5WGSVI>$$$ 5WLMIPHW"
">$ 555KEQI$SZIV% 5LMX$VEXMS>$ 4"
"_ LIPT5AAAA"
"50$qsziw$pi"
"jx52$qsziw$"
"vmklx5wtegi" "fev$wlssxw5" "w$xskkpiw$w" "syrh5t$teyw" "iw5u$uymxw", _, *O;
int i, s =
0, H = 5, T, F = 0, Z
= 0, N = 1, X = 0, E = 0, x = 7, V[8], M[8], W[8], m, a;
int
r (int s)
{
if (s)
a = s;
while (!(a & 1 && a % 5))
a++;
a *= 997;
a &= 0xffffff;
return 15 & a >> 4;
}
void
P (int x)
{
puts (w + x);
} int
G ()
{
return read (0, &_, 1);
}
void
Y ()
{
while (G () < 0)
;
}
void
I (int y, int x)
{
printf ("%s%d", w + y, x);
} void
Q (int x)
{
I (114, x / 100);
p (67);
P (x % 100);
} void
B (int c)
{
printf ("\033[%d;%d;40m", c > 37, c & 63);
} struct termios o, n;
void
b (int w, int c)
{
B (c);
p (w);
B ('%');
} int
main ()
{
O = w;
do
if (*O == 32)
*O = 0;
else if (*O == 52)
*O = 27;
else if (*O == 53)
*O = 10;
else
*O -= 4;
while (*++O);
tcgetattr (0, &o);
tcgetattr (0, &n);
n.c_lflag &= ~ICANON;
n.c_cc[VMIN] = 1;
n.c_lflag &= ~ECHO;
tcsetattr (0, TCSANOW, &n);
fcntl (0, F_SETFL, fcntl (0, F_GETFL) | O_NONBLOCK);
B ('%');
for (i = 0; i < 8; i++)
V[i] = M[i] = W[i] = 0;
while (i)
{
P (0);
for (m = 0; m < i; m++)
P (7);
if (m < 7)
Q (308);
if (m < 6)
Q (319);
if (m < 5)
Q (730);
if (m < 4)
Q (233);
if (m < 3)
P (7);
if (m < 2)
Q (346);
i--;
usleep (300000);
}
Y ();
T = r (255);
while (!E)
{
B ('%');
F++;
if (!T)
{
*M |= 1 << r (0);
T = r (0) - s / 15;
if (T < 1)
T = 1;
}
else
T--;
if (G ())
{
if (_ == 113)
E = 1;
if (_ == 44)
x--;
if (_ == 46)
x++;
if (_ == 104)
{
P (0);
P (117);
Y ();
}
if (_ == 115)
N = !N;
if (_ == 112)
{
Y ();
_ = 0;
}
if (_ == 32)
{
V[7] |= 1 << (x + 1);
Z++;
a += F;
}
if (_ == 27)
{
G ();
if (_ == 91)
{
G ();
if (_ == 68)
x--;
if (_ == 67)
x++;
}
}
if (x < 1)
x++;
if (x > 13)
x--;
_ = 0;
}
P (0);
for (i = 0; i < 8; i++)
{
for (m = 1; m < 1 << 16; m <<= 1)
{
if ((V[i] & m) & (M[i] & m))
{
b (42, '_');
V[i] &= ~m;
M[i] &= ~m;
if (!(++s & 31))
H++;
}
else if (V[i] & m)
b (33, 'a');
else if (M[i] & m)
b (84, '`');
else if (W[i] & m)
p (46);
else
p (32);
}
p (73);
P (7);
}
m = 7 << x;
if (M[7] & m)
{
if (--H < 0)
E = 1;
if (!H)
X = 5;
if (N)
p (7);
M[7] &= ~m;
B ('_');
Q (x * 100 + 57);
B ('%');
}
else
{
B ('e');
Q (x * 100 + 61);
B ('%');
}
I (66, s);
I (76, H);
p (10);
if (!(F & 7))
{
for (i = 7; i > 0; i--)
W[i] = W[i - 1];
*W = 1 << r (0);
}
if (F & 1)
{
for (i = 0; i < 7; i++)
V[i] = V[i + 1];
V[7] = 0;
}
if (!(F & 3))
{
for (i = 7; i > 0; i--)
M[i] = M[i - 1];
*M = 0;
}
usleep (33000);
if (X)
{
if (!--X == 0)
if (N)
p (7);
}
}
P (0);
P (88);
I (65, s);
if (Z)
I (101, s * 100 / Z);
p (37);
p (10);
p (10);
tcsetattr (0, TCSANOW, &o);
return 0;
}