hat einen schönen retro look, aber noch keine "win-detection"
falls demand ideen hat wie ich nicht jeden der 59 situationen einzeln programmieren müsste, bitte reinschreiben.
Danke
Code: Alles auswählen
s1=["_","_","_","_","_","_"]
s2=["_","_","_","_","_","_"]
s3=["_","_","_","_","_","_"]
s4=["_","_","_","_","_","_"]
s5=["_","_","_","_","_","_"]
s6=["_","_","_","_","_","_"]
s7=["_","_","_","_","_","_"]
l1=1-1
l2=1-1
l3=1-1
l4=1-1
l5=1-1
l6=1-1
l7=1-1
def addset( player, slot ):
global l1
global l2
global l3
global l4
global l5
global l6
global l7
if slot=="1":
s1[l1]=player
l1+=1
if slot=="2":
s2[l2]=player
l2+=1
if slot=="3":
s3[l3]=player
l3+=1
if slot=="4":
s4[l4]=player
l4+=1
if slot=="5":
s5[l5]=player
l5+=1
if slot=="6":
s6[l6]=player
l6+=1
if slot=="7":
s7[l7]=player
l7+=1
def write():
for i in range(0,6):
print(s1[5-i]+" "+s2[5-i]+" "+s3[5-i]+" "+s4[5-i]+" "+s5[5-i]+" "+s6[5-i]+" "+s7[5-i])
print "1 2 3 4 5 6 7"
print "STARTING GAME"
while True:
position = raw_input("PLAYER X WHAT SLOT DO YOU WANT TO PLACE ON_")
addset("X",position)
write()
position = raw_input("PLAYER O WHAT SLOT DO YOU WANT TO PLACE ON_")
addset("O",position)
write()