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

Code from 10 years ago

Name: Anonymous 2012-12-12 0:20

I just found this shit that I wrote in 2002.
What do you think of it, /prague/?

menu:
CLS
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ͻ"
PRINT "▒ The Encryption Program ▒"
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒͹"
PRINT "▒ 1 ▒ Encrypt            ▒"
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ķ"
PRINT "▒ 2 ▒ Decrypt            ▒"
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ķ"
PRINT "▒ 3 ▒ Exit               ▒"
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ķ"
PRINT "▒ Command:               ▒"
PRINT "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ͼ"
LOCATE 10, 12
INPUT "", C$
IF C$ = "1" THEN
        GOSUB encrypt
        ELSEIF C$ = "2" THEN GOSUB decrypt
        ELSEIF C$ = "3" THEN GOSUB exitprog
        END IF
GOTO menu
encrypt:
LOCATE 12, 1
INPUT "Input File: ", f$
INPUT "Output File: ", of$
INPUT "Password: ", p$
rp = 0
FOR i = 1 TO LEN(p$)
rp = rp + ASC(MID$(p$, i, 1))
NEXT i
RANDOMIZE rp
OPEN f$ FOR BINARY ACCESS READ AS #1
OPEN of$ FOR BINARY ACCESS WRITE AS #2
b = 1
ob = 1
inbyte$ = " "
WHILE NOT EOF(1)
GET #1, b, inbyte$
b = b + 1
IF EOF(1) THEN GOTO inputfileend
outbyte$ = ""
FOR i = 1 TO INT(RND * LEN(p$)) + 1
outbyte$ = outbyte$ + CHR$(ASC(inbyte$) + ASC(MID$(p$, INT(RND * LEN(p$))
+ 1, 1)) MOD 256)
NEXT i
PUT #2, ob, outbyte$
ob = ob + LEN(outbyte$)
WEND
PRINT "Encryption Complete."
PRINT f$; " > "; of$
WHILE INKEY$ = ""
WEND
CLOSE #1
CLOSE #2
RETURN
decrypt:
LOCATE 12, 1
INPUT "Input File: ", f$
INPUT "Output File: ", of$
INPUT "Password: ", p$
rp = 0
FOR i = 1 TO LEN(p$)
rp = rp + ASC(MID$(p$, i, 1))
NEXT i
RANDOMIZE rp
OPEN f$ FOR BINARY ACCESS READ AS #1
OPEN of$ FOR BINARY ACCESS WRITE AS #2
b = 1
ob = 1
inbyte$ = " "
WHILE NOT EOF(1)
FOR i = 1 TO INT(RND * LEN(p$)) + 1
GET #1, b, inbyte$
b = b + 1
outbyte1 = ASC(inbyte$) - ASC(MID$(p$, INT(RND * LEN(p$)) + 1, 1))
WHILE outbyte1 < 0
outbyte1 = outbyte1 + 256
WEND
IF i = 1 THEN outbyte = outbyte1
IF outbyte <> outbyte1 THEN GOTO progerr
NEXT i
outbyte$ = CHR$(outbyte)
PUT #2, ob, outbyte$
ob = ob + 1
WEND
inputfileend:
CLOSE #1
CLOSE #2
PRINT "Decryption Complete."
PRINT f$; " > "; of$
WHILE INKEY$ = ""
WEND
RETURN
progerr:
PRINT "Error: Incorrect Password"
WHILE INKEY$ = ""
WEND
RETURN
exitprog:
SYSTEM

Name: Anonymous 2012-12-12 7:34

I was writing without indentation out of an old computer of my dad's.

program snake;
uses wincrt;
type
norm=array[1..72,1..24] of record
occupied: boolean;
life: byte;
end;
var
teclas: array[1..2] of record
nome: string;
up,down,left,right: char;
end;
multi: array[1..2] of record
teclas: record
nome: string;
up,down,left,right: char;
end;
highscore,points,maxlife,plustotal,padrao,mapx,mapy: longint;
menu,prevmenu: char;
end;
padrao: byte;
textfile: text;
file1: file of longint;
filemap: file of norm;
mapname: string[12];
menu,prevmenu,submenu,choice,symbol: char;
cont1,cont2,mapx,mapy: longint;
defeat: boolean;
highscore: longint;
map: norm;
speed,cresc,points: longint;
plusx,plusy: byte;
plustotal: word;
maxlife: byte;
procedure timer;
begin  
for cont2:=1 to (11-speed)*110000 do write('');
end;        
begin
randomize;
writeln('Erro: Falta ficheiros');
assign(file1,'snakesav.dat');
reset(file1);
read(file1,highscore);
close(file1);
clrscr;
teclas[1].nome:='Padrão WASD';
teclas[1].up:='W';
teclas[1].down:='S';
teclas[1].left:='A';
teclas[1].right:='D';
teclas[2].nome:='Numérico esquerdo';
teclas[2].up:='8';
teclas[2].down:='2';
teclas[2].left:='4';
teclas[2].right:='6';
symbol:='#';
repeat
repeat
clrscr;
writeln;
writeln(' :SNAKE:');
writeln;
writeln(' a - Jogo Solo');
writeln(' b - 2 Jogadores(!)');
writeln(' c - Instrucções');
writeln(' d - Sair');
write(' ');
menu:=upcase(readkey);
if menu='C' then begin
writeln;
writeln;
writeln;
writeln;
writeln(' -Direccionais');
writeln;
writeln('    W                   8');
writeln('  A   D       ou      4   6         P para parar a partida');
writeln('    S                   2');
writeln;
writeln(' ! -> Apanhe para a cobra crescer e ganhar pontos / Nr apanhado');
writeln(' V -> Velocidade da partida');
writeln(' C -> Velocidade de crescimento da cobra');
writeln(' P -> Pontos da partida');
writeln(' R -> Recorde de pontos de todas as partidas');
writeln;
write('  Não embate nas paredes ou na própria cobra senão perde o jogo.');
readkey;
end;
if menu='D' then donewincrt;
until (menu='A') or (menu='B');
if menu='A' then begin
mapname:='level001.txt';
speed:=1;
cresc:=1;
padrao:=1;
repeat
clrscr;
writeln;
writeln(' :SNAKE:');
writeln;
writeln(' a - Mapa=',mapname);
writeln(' b - Velocidade=',speed);
writeln(' c - Crescimento=',cresc);
writeln(' d - Teclas=',teclas[padrao].nome);
writeln(' e - Aceitar e continuar');
write(' ');
submenu:=upcase(readkey);
if submenu='A' then begin
gotoxy(11,4);
readln(mapname);
mapname:=mapname+'.txt';
clrscr;
writeln('Erro: Mapa não encontrado, programa crashou');
assign(textfile,mapname);
reset(textfile);
close(textfile);
end;
if submenu='B' then
repeat
gotoxy(17,5);
readln(speed);
until (speed>=1) and (speed<=10);
if submenu='C' then
repeat
gotoxy(18,6);
readln(cresc);
until (cresc>=1) and (cresc<=10);
if submenu='D' then
if padrao=1 then padrao:=2 else padrao:=1;  
until submenu='E';     
clrscr;
defeat:=false;
maxlife:=10;
prevmenu:=teclas[padrao].up;
points:=0;
plustotal:=0;
assign(textfile,mapname);
reset(textfile);
for cont2:=1 to 24 do begin
for cont1:=1 to 72 do begin
read(textfile,symbol);
if symbol='1' then begin
map[cont1,cont2].occupied:=true;
gotoxy(cont1,cont2);
write('N');
end else begin
map[cont1,cont2].occupied:=false;
end;
end;


and so on

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