' Maxit ' Version 1.0 ' (c) 1999 by MONSTERVISION ' Variablen ' b = aktuelle Breite ' c = Computerst„rke ' e = Prfung bester Zug computer e=0 sonst e=1 ' h = aktuelle H”he ' j$ = Neues Spiel ' m = Zahlwahl Computer ' p = Punkte Spieler ' r = Ziel Computer ' s = aktueller Spieler ' s$ = Spielernamen ' t = Prfung ob Spielende ' w = Zustand der Zahlen ' z = Zahlen display 0 dim e(2), p(2), s$(1), w(8,8), z(8,8) randomize ' Neu 100 cls e(0)=0 e(1)=0 c=0 s=0 locate 1,1,0:print "MAXIT" ' Spieler 1 110 locate 4,3,1:input "Name Spieler 1: ",s$(0) if len(s$(0))>10 then goto 400 ' Spieler 2 120 locate 5,3,1:input "Name Spieler 2: ",s$(1) if len(s$(1))>10 then goto 410 for x=1 to 8 for y=1 to 8 z(x,y)=int(19*rnd)-9 w(x,y)=1 next y next x p(0)=0 p(1)=0 if s$(0) = "" then goto 500 if s$(1) = "" then goto 440 ' Bildaufbau 200 cls for x=1 to 8 for y=1 to 8 if z(x,y)<0 then locate x,(y*3)-2,0:print z(x,y) else locate x,(y*3)-1,0:print z(x,y) next y next x locate 1,25,0: print "MAXIT" locate 3,25,0: print s$(0);":" locate 4,25,0: print s$(1);":" h=1 b=2 goto 430 ' Tastaturabfrage 300 while e$="" e$=inkey$ if s=0 and c=2 then gosub 510 if s=1 and c>0 then gosub 450 wend if e$="KK" and s=0 then goto 310 if e$="MM" and s=0 then goto 320 if e$="HH" and s=1 then goto 330 if e$="PP" and s=1 then goto 340 if e$=chr$(13) and w(h,(b+1)/3)=1 then goto 360 locate h,b,1 e$="" goto 300 ' links 310 if b=2 then b=23 else b=b-3 goto 350 ' rechts 320 if b=23 then b=2 else b=b+3 goto 350 ' hoch 330 if h=1 then h=8 else h=h-1 goto 350 ' runter 340 if h=8 then h=1 else h=h+1 ' Cursor richten 350 e$="" locate h,b,1 goto 300 ' Enter 360 w(h,(b+1)/3)=0 locate h,b-1,0:print " " p(s)=p(s)+z(h,(b+1)/3) locate 3+s,37,0: print " " locate 3+s,37,0: print p(s) if s=0 then goto 370 else goto 380 ' Horizontale Abfrage 370 s=1 t=0 for x=1 to 8 if w(x,(b+1)/3)=1 then t=1 next x if t=1 then goto 430 else goto 390 ' Diagonale Abfrage 380 s=0 t=0 for x=1 to 8 if w(h,x)=1 then t=1 next x if t=1 then goto 430 else goto 390 ' Ende 390 locate 6,25,0:print "Spielende" if p(0)=p(1) then goto 420 if p(0)m and w(x,(b+1)/3)=1 then r=x:m=z(x,(b+1)/3) next x e(1)=1 goto 460 ' Computer 2 zieht 460 if h=r then goto 470 if h>r then goto 480 if hm and w(h,x)=1 then r=(x*3)-1:m=z(h,x) next x e(0)=1 goto 520 ' Computer 1 zieht 520 if b=r then goto 530 if b>r then goto 540 if b