Gizmogidget
2016-04-02, 02:23 PM
I have been having problems with my dice game code that I copied from a practice example. It returns syntax/keyboard errors. I have never had the practice code not work. My teacher has been spectacularly unhelpful, and I can't seem to get a hold of him.
The code is as follows
from dice import Dice
player_dice = Dice(10)
computer_dice = Dice(10)
while (player_dice.count_dice() > 0
and computer_dice.count_dice() > 0):
print("Your dice:\t\t" + str(player_dice.count_dice()))
print("Computer's dice:|t" + str(computer_dice.count_dice()))
print("Press the ENTER key to roll!")
input()
player_dice.roll_dice()
computer_dice.roll_dice()
player_total = player_dice.add_up_total()
computer_total = computer_dice.add_up_total()
print("You rolled " + player_dice.dice_to_string() +
", for a total of" + str(player_total) = ".")
print("The computer rolled " + computer_dice.dice_to_string() +
", for a total of " + str(computer_total) + ".")
Thanks for all the help I have gotten in the past
The code is as follows
from dice import Dice
player_dice = Dice(10)
computer_dice = Dice(10)
while (player_dice.count_dice() > 0
and computer_dice.count_dice() > 0):
print("Your dice:\t\t" + str(player_dice.count_dice()))
print("Computer's dice:|t" + str(computer_dice.count_dice()))
print("Press the ENTER key to roll!")
input()
player_dice.roll_dice()
computer_dice.roll_dice()
player_total = player_dice.add_up_total()
computer_total = computer_dice.add_up_total()
print("You rolled " + player_dice.dice_to_string() +
", for a total of" + str(player_total) = ".")
print("The computer rolled " + computer_dice.dice_to_string() +
", for a total of " + str(computer_total) + ".")
Thanks for all the help I have gotten in the past