Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. # game intro
  2. print('''
  3. [-] : Empty positions
  4. [P] : Player
  5. [B] : Box
  6. [S] : Storage point
  7. ''')
  8. # create map and first moving
  9. m = [["-","-","-","-"] ,
  10.     ["-","P","-","-"] ,
  11.     ["-","-","-","-"] ,
  12.     ["-","-","-","-"] ,
  13. ]
  14. for i in m :
  15.     for c in i :
  16.         print(c, end = " ")
  17.     print()
  18.  
  19. # set location
  20. x = 0
  21. y = 0
  22. P = m[x][y]
  23.  
  24. b = input("Your next move? ")
  25. while b in ["a", "s", "d", "w"] :    
  26.     if b == "a" :
  27.         P = m[x][y - 1]
  28.         for i in m :
  29.             for c in i :
  30.                 print(c, end = " ")
  31.             print()
  32.         b = input("Your next move? ")
  33.     elif b == "s" :
  34.         P = m[x + 1][y]  
  35.         for i in m :
  36.             for c in i :
  37.                 print(c, end = " ")
  38.             print()
  39.         b = input("Your next move? ")
  40.     elif b == "d" :
  41.         P = m[x][y + 1]
  42.         for i in m :
  43.             for c in i :
  44.                 print(c, end = " ")
  45.             print()
  46.         b = input("Your next move? ")
  47.     else :
  48.         P = m[x - 1][y]  
  49.         for i in m :
  50.             for c in i :
  51.                 print(c, end = " ")
  52.             print()
  53.         b = input("Your next move? ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement