Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pig.py #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions pig.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
comp_total = 0
turn = "player"
winning_score = 50
apple_pie = 0

while not done:
while turn == "player" and not done:
Expand All @@ -22,7 +23,11 @@
if roll == 1:
turn = "computer"
player_temp_total = 0
print("PIG! Too bad! Your total is currently:", player_total)
print("PIG! How could you let the machines win??? Your total is currently:", player_total)
if roll == 3:
turn = "computer"
player_temp_total += roll
print("You found an Apple Pie! Hold onto these, they might help you when the machines get too powerful....",player_total)
else:
player_temp_total += roll
print("You currently have " + str(player_temp_total) + " banked.")
Expand All @@ -33,7 +38,7 @@
print("Your total socre is now:", player_total)
turn = "computer"
if player_total > winning_score:
print("You win! " + str(player_total) + " to " + str(comp_total))
print("You win!Go humans!Boo machines! " + str(player_total) + " to " + str(comp_total))
done = True

while turn == "computer" and not done:
Expand All @@ -50,11 +55,15 @@
comp_temp_total += roll
print("The computer has " + str(comp_temp_total) + " banked.")
if comp_temp_total > 6 or comp_total + comp_temp_total > winning_score:
print("The computer has chosen to end its turn.")
print("The computer has chosen to end its turn")
comp_total += comp_temp_total
comp_temp_total = 0
print("The computer's score is now:", comp_total)
turn = "player"
if comp_total > winning_score:
print("The computer wins! " + str(comp_total) + " to " + str(player_total))
done = True
if apple_pie>1:
print("You win! You saved humanity using apple pie! Go put that on your Resume!")
else
print("The computer wins! How could you! ")

done = True