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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -