Untitled


SUBMITTED BY: Kiliandeca

DATE: Aug. 1, 2016, 5:15 p.m.

FORMAT: Python 3

SIZE: 552 Bytes

HITS: 482

  1. l = [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]
  2. l[0][0] = 1
  3. x = 0
  4. y = 0
  5. def afficher():
  6. for a in l:
  7. print(a, "\n")
  8. afficher()
  9. while True:
  10. i = input()
  11. if i =="d" and x < 4:
  12. l[y][x]= 0
  13. x += 1
  14. l[y][x]= 1
  15. elif i =="q" and x > 0:
  16. l[y][x] = 0
  17. x -= 1
  18. l[y][x] = 1
  19. elif i == "z" and y > 0:
  20. l[y][x] = 0
  21. y -= 1
  22. l[y][x] = 1
  23. elif i == "s" and y < 4:
  24. l[y][x] = 0
  25. y += 1
  26. l[y][x] = 1
  27. afficher()

comments powered by Disqus