Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- positionList = []
- okayToContinue = 0
- gap = 3
- for _ in range(10):
- okayToContinue = 0
- pos = random.randint(1,40)
- while okayToContinue != 1:
- for item in positionList:
- for i in range (1, gap):
- if (pos + i) == item:
- print "+"
- pos = random.randint(1,40)
- okayToContinue = 0
- elif (pos - i) == item:
- print "-"
- pos = random.randint(1,40)
- okayToContinue = 0
- elif pos == item:
- print "="
- pos = random.randint(1,40)
- okayToContinue = 0
- else:
- okayToContinue = 1
- if len(positionList) < 1:
- okayToContinue = 1
- positionList.append(pos)
- print positionList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement