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 3:03

>>1
I like it. Any way to get it to run on a modern computer?

Also, since we're talking about code from our programming infancy, here's a tetris I wrote in JABBA when I was first learning programming:

https://gist.github.com/4265925

Highlights:
*200+ line main
*Everything in one while loop, Thread.sleep()
*Didn't understand what JLabels were so just made new ones/removed all old ones every update cycle
*int[][]


private boolean canrotate(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
if ( (ax > -1) && (bx > -1) && (cx > -1) && (dx > -1) &&
(ax < gridx) && (bx < gridx) && (cx < gridx) && (dx < gridx) &&
(ay > -1) && (by > -1) && (cy > -1) && (dy > -1) &&
(ay < gridy) && (by < gridy) && (cy < gridy) && (dy < gridy) &&
(!game.isStatic(ax,ay)) && (!game.isStatic(bx,by)) && (!game.isStatic(cx,cy)) && (!game.isStatic(dx,dy)) ) {
return true;
}
return false;
}


I think I was a lot smarter back then.

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