Posted by Anonymous on Sat 22 Aug 07:40
report abuse | download | new post
- import random
- state = 1
- while state == 1:
- print ""
- print ""
- nx = random.randint(0, 30)
- ny = random.randint(0, 10)
- board = {}
- for x in range(30):
- for y in range(10):
- if (x == nx and y == ny):
- board[x,y] = "==";
- else:
- if (random.randint(0, 1) == 1):
- board[x,y] = "##"
- else:
- board[x,y] = " "
- for y in range(10):
- s = ""
- for x in range(30):
- s = s + board[x,y]
- print s
- print s
- print ""
- print ""
- try:
- state = input("Press enter to generate another or 0 to exit: ")
- except:
- state = 1
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.