Skip to content

Instantly share code, notes, and snippets.

@smspillaz
Created May 11, 2015 12:56
Show Gist options
  • Save smspillaz/8b386d8185d94200ee18 to your computer and use it in GitHub Desktop.
Save smspillaz/8b386d8185d94200ee18 to your computer and use it in GitHub Desktop.
print map
game_map = list()
for i in range(0, 28):
sub = []
for j in range(0, 36):
sub.append(False)
game_map.append(sub)
for i in range(0, 28):
for j in range(0, 36):
game_map[i][j]= False
if(j==8 or j == 32):
game_map[i][j] = True
if((j==4 or j== 23) and (i!=13 and i!=14)):
game_map[i][j] = True
if((j==11 or j==29) and (i!=7 and i!=8 and i!=13 and i!=14 and i!=19 and i!=20) ):
game_map[i][j] = True
if((j==14 or j== 20) and (i>9 and i<18)):
game_map[i][j] = True
if((j==26) and (i!=4 and i!=5 and i!=22 and i!=23)):
game_map[i][j] = True
if(j<4 or j>32 or i==0 or i==27):
game_map[i][j] = False
if((j==17) and (i<9 or i>18)):
game_map[i][j] = True
if((i==6 or i ==21) and (j>=5 and j<=28)):
game_map[i][j] = True
if((i==1 or i ==26) and ((j>=5 and j<=11) or (j>=23 and j<=26) or (j>=29 and j<=32)) ):
game_map[i][j] = True
if((i==3 or i==24) and (j==27 or j==28)):
game_map[i][j] = True
if((i==9 or i==18) and (j==9 or j==10 or (j>=14 and j<=22) or j==27 or j==28)):
game_map[i][j] = True
if((i==12 or i==15) and ((j>=5 and j<=7) or j==12 or j==13 or j==24 or j==25 or j==30 or j==31)):
game_map[i][j] = True
new_game_map = []
for i in range(0, 36):
sub = []
for j in range(0, 28):
sub.append(False)
new_game_map.append(sub)
for i in range(0, 28):
for j in range(0, 36):
new_game_map[j][i] = game_map[i][j]
import sys
sys.stdout.write(" ")
for j in range(0, len(new_game_map[0])):
sys.stdout.write("|%02d" % j)
sys.stdout.write("|\n")
for i, sub in enumerate(new_game_map):
sys.stdout.write("%02d " % i)
for pos in sub:
sys.stdout.write("|" + (".." if pos else "@@"))
sys.stdout.write("|\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment