Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- i = 0
- numLegs = 0
- maxLegs=6
- numEyes = 0
- maxEyes=2
- head = 0
- numAnt = 0
- maxAnt = 2
- tail = 0
- body = 0
- done = False
- error = 0
- diceRoll = 0
- turns = 0
- while not done:
- error = False
- diceRoll = input (" Input dice roll: ")
- if diceRoll == 1:
- if body == 0:
- body = 1
- else:
- error = True
- elif diceRoll ==2:
- if body == 1 and head == 0:
- head = 1
- else:
- error = True
- elif diceRoll == 3:
- if body == 1 and numLegs < maxLegs:
- numLegs = 1
- else:
- error = True
- elif diceRoll == 4:
- if head == 1 and numAnt < maxAnt:
- numAnt += 1
- else:
- error = True
- elif diceRoll == 5:
- if head == 1 and numEyes < maxEyes:
- numEyes += 1
- else:
- error = True
- elif diceRoll == 6:
- if body == 1 and tail == 0 :
- tail = 1
- else:
- error = True
- else:
- print " Invalid input."
- antOut = ""
- if numAnt > 0:
- antOut += " !"
- if numAnt == 2:
- antOut += " |"
- print antOut
- headOut = ""
- if head == 1:
- headOut += " ("
- if numEyes > 0:
- headOut += "o "
- else:
- headOut += " "
- if numEyes == 2:
- headOut += "o"
- print headOut
- for i in range(0, maxLegs, 2):
- bodyOut = ""
- if numLegs > i:
- bodyOut += "- "
- else:
- bodyOut += " "
- if body == 1:
- bodyOut += "[ ]"
- if numLegs > i + 1:
- bodyOut += " _ "
- else:
- bodyOut += " "
- print bodyOut
- if tail == 1:
- print " T"
- if error:
- print " Can't add a part.\n"
- turns += 1
- if body == 1 and numLegs == maxLegs and numEyes == maxEyes and numAnt == maxAnt and tail == 1:
- print " Congratulations you have completed your cootie!"
- print " It took you ", turns, " turns to finish your cootie."
- done = True
- return 0
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement