c++ - How could you write the "if - then" logic for the game Yacht? -
https://en.wikipedia.org/wiki/yacht_(dice_game)
i created 5 dice in c++ program , each roll random numbers 1-6. if 1's simple. it's just:
if (dice1 == 1 && dice2 == 1 && dice3 == 1 && dice4 == 1 && dice5 == 1) { int total = 50; }
also, summing dice easy too. how write if-statement "if 2 4 dice same sum dice"? there simple way that?
try use tables , make variable count 1 in table. u can compare it.
Comments
Post a Comment