Some private notes

Nix besonderes, aber wer hat keinen Blog?

20 Jahre Doom – und damit 20 Jahre PC

Posted on Dezember 11th, 2013 in Computer by Sammy98 || No Comment

Mit ein wenig Nostalgie schaue ich doch ab und an zurück auf meine Anfänge mit dem PC.
Damals – 486/DX2-40 mit VLB und 5MB Ram – ganz weit vorne mit dabei. Zuerst nur rumspielen, dann irgendwann gings an das Programmieren. Zunächst VB, dann Pascal, C/C++, Delphi, HTML, Java, DotNet, PHP bis heute.
Aber nach meinem ältesten Programmcode hatte es ja schon in dem Eintrag gesucht. Zu dem Zeitpunkt hatte ich 3 alte Disketten extrahiert und somit vor dem ewigen verlieren gerettet. Der zu dem Zeitpunkt älteste nchvollziehbare Programmcode von mir war von 1996. Allerdings war das schon Pascal und vorher hatte ich mit Basic angefangen. Ich hatte auch „defekte“ BAS Dateien, die ich allerdings heute mit QBasic 4.5 erneut öffnen und exportieren konnte.

Somit habe ich eine neue bestätigte Datei, die ich damals programmiert hatte. Es war ein simples Schiffe-Versenken ohne GUI. Zeitstempel 05.01.1994.



DECLARE SUB setflag1 (p1, p2, p3, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
DECLARE SUB setflag2 (p4, p5, p6, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
DECLARE SUB makethem (p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
DECLARE SUB tarn ()
wer = 1
CLS
LOCATE 2, 2: PRINT "Schiffe versenken (C) Michael K"
i1:
LOCATE 4, 2: PRINT "Wieviele Spieler : "
LOCATE 5, 2: PRINT "(1 oder 2)"
i$ = ""
WHILE i$ = ""
i$ = INKEY$
WEND
LOCATE 4, 21: PRINT i$
IF i$ <> "1" AND i$ <> "2" GOTO i1
IF i$ = "1" THEN GOTO p1
IF i$ = "2" THEN GOTO p2
END
p1:
LOCATE 5, 2: INPUT "Name Player 1 : ", name1$
name1$ = UCASE$(LEFT$(name1$, 1)) + LCASE$(RIGHT$(name1$, LEN(name1$) - 1))
END

p2:
CALL makethem(p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
LOCATE 5, 2: INPUT "Name Player 1 : ", name1$
name1$ = UCASE$(LEFT$(name1$, 1)) + LCASE$(RIGHT$(name1$, LEN(name1$) - 1))
LOCATE 5, 10: PRINT " "
LOCATE 5, 2: INPUT "Name Player 2 : ", name2$
name2$ = UCASE$(LEFT$(name2$, 1)) + LCASE$(RIGHT$(name2$, LEN(name2$) - 1))
LOCATE 4, 1: PRINT " "
LOCATE 4, 1: PRINT " "; name1$
LOCATE 4, 31: PRINT name2$; " "
p2go:
LOCATE 5, 1: PRINT " A B C D E F G H A B C D E F G H "
FOR i = 1 TO 6
LOCATE i + 5, 1: PRINT i; " "; i
NEXT
RANDOMIZE TIMER
wer = INT(RND * 2) + 1
LOCATE 18, 3: PRINT "Spieler"; wer; "darf anfangen !"
IF wer$ = "1" THEN p = 1
IF wer$ = "2" THEN p = 2
WHILE INKEY$ = "": WEND
in2:
LOCATE 18, 3: PRINT "Ihre Koordinaten Player"; wer; " : "
inx:
a$ = ""
WHILE a$ = ""
a$ = INKEY$
WEND
IF ASC(a$) = 27 THEN CLS : END
a$ = UCASE$(a$)
SELECT CASE a$
CASE "A": x = 1
CASE "B": x = 2
CASE "C": x = 3
CASE "D": x = 4
CASE "E": x = 5
CASE "F": x = 6
CASE "G": x = 7
CASE "H": x = 8
CASE ELSE: GOTO inx
END SELECT
iny:
LOCATE 18, 3: PRINT "Ihre Koordinaten Player"; wer; " : "
LOCATE 18, 33: PRINT a$
z$ = ""
WHILE z$ = ""
z$ = INKEY$
WEND
IF ASC(z$) = 27 THEN CLS : END
z$ = UCASE$(z$)
LOCATE 18, 34: PRINT z$
SELECT CASE z$
CASE "1": y = 1
CASE "2": y = 2
CASE "3": y = 3
CASE "4": y = 4
CASE "5": y = 5
CASE "6": y = 6
CASE ELSE: GOTO iny
END SELECT
IF wer = 1 THEN
CALL setflag1(p1, p2, p3, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
wer = 2: GOTO in2
END IF
IF wer = 2 THEN
CALL setflag2(p4, p5, p6, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
wer = 1: GOTO in2
END IF
END

SUB makethem (p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
RANDOMIZE TIMER
p1x1 = INT(RND * 8) + 1
p1y1 = INT(RND * 6) + 1
p1x2 = INT(RND * 8) + 1
p1y2 = INT(RND * 6) + 1
p1x3 = INT(RND * 8) + 1
p1y3 = INT(RND * 6) + 1
p2x1 = INT(RND * 8) + 1
p2y1 = INT(RND * 6) + 1
p2x2 = INT(RND * 8) + 1
p2y2 = INT(RND * 6) + 1
p2x3 = INT(RND * 8) + 1
p2y3 = INT(RND * 6) + 1
EXIT SUB
END SUB

SUB setflag1 (p1, p2, p3, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
px = x
py = y
IF px = p1x1 AND py = p1y1 THEN p1 = 100: GOTO treffer
IF px = p1x2 AND py = p1y2 THEN p2 = 100: GOTO treffer
IF px = p1x3 AND py = p1y3 THEN p3 = 100: GOTO treffer
LOCATE y + 5, 2 * x + 2: PRINT "±"
EXIT SUB

treffer:
IF px = p1x1 THEN LOCATE 20, 3: PRINT "Sie haben Chirac getroffen !"
IF px = p1x2 THEN LOCATE 20, 3: PRINT "Sie haben Chirac`s Frau getroffen !"
IF px = p1x3 THEN LOCATE 20, 3: PRINT "Sie haben Chirac`s Kind getroffen !"
BEEP
LOCATE y + 5, 2 * x + 2: PRINT CHR$(1)
FOR i = 1 TO 5000: NEXT
LOCATE y + 5, 2 * x + 2: PRINT CHR$(2)
FOR i = 1 TO 5000: NEXT
LOCATE y + 5, 2 * x + 2: PRINT CHR$(1)
SLEEP 1
LOCATE 20, 3: PRINT " "
IF p1 = 100 AND p2 = 100 AND p3 = 100 THEN
LOCATE 20, 3: PRINT "Player 1 hat gewonnen !"
LOCATE 24, 1: PRINT "";
END
END IF
EXIT SUB
END SUB

SUB setflag2 (p4, p5, p6, x, y, p1x1, p1x2, p1x3, p2x1, p2x2, p2x3, p1y1, p1y2, p1y3, p2y1, p2y2, p2y3)
RESET
px = x
py = y
IF px = p2x1 AND py = p2y1 THEN p4 = 100: GOTO treffer1
IF px = p2x2 AND py = p2y2 THEN p5 = 100: GOTO treffer1
IF px = p2x3 AND py = p2y3 THEN p6 = 100: GOTO treffer1
LOCATE y + 5, 2 * x + 29: PRINT "±"
EXIT SUB

treffer1:
IF px = p2x1 THEN LOCATE 20, 3: PRINT "Sie haben Chirac getroffen !"
IF px = p2x2 THEN LOCATE 20, 3: PRINT "Sie haben Chirac`s Frau getroffen !"
IF px = p2x3 THEN LOCATE 20, 3: PRINT "Sie haben Chirac`s Kind getroffen !"
BEEP
LOCATE y + 5, 2 * x + 29: PRINT CHR$(1)
FOR i = 1 TO 5000: NEXT
LOCATE y + 5, 2 * x + 29: PRINT CHR$(2)
FOR i = 1 TO 5000: NEXT
LOCATE y + 5, 2 * x + 29: PRINT CHR$(1)
SLEEP 1
LOCATE 20, 3: PRINT " "
IF p4 = 100 AND p5 = 100 AND p6 = 100 THEN
LOCATE 20, 3: PRINT "Player 2 hat gewonnen !"
END
END IF
EXIT SUB
END SUB

SUB tarn
CLS
PRINT "a:\"
WHILE INKEY$ = "": WEND
CLS
LOCATE 2, 2: PRINT "Schiffe versenken (C) Michael K"
LOCATE 4, 1: PRINT " "; name1$
LOCATE 4, 30: PRINT name2$; " "
LOCATE 5, 1: PRINT " A B C D E F G H A B C D E F G H "
FOR i = 1 TO 6
LOCATE i + 5, 1: PRINT i; " "; i
NEXT

END SUB

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.