Yahtzee by Storm Dragon Released under the terms of the WTFPL: http://wtfpl.net/ OVERVIEW Yahtzee is a classic dice game where you roll five dice and try to make specific combinations to score points. The goal is to fill all 13 scoring categories on your score sheet with the highest possible scores. GETTING STARTED Running the game: ./yahtzee - Play against CPU opponent (2 player mode) ./yahtzee 1 - Play solo (solitaire mode) ./yahtzee 3 - Play with 3 human players ./yahtzee N - Play with N human players GAME RULES On each turn, you get up to 3 rolls of five dice: 1. First roll - All 5 dice are rolled 2. After seeing the results, choose which dice to keep and which to reroll 3. Second roll - Selected dice are rerolled 4. Choose again which dice to keep/reroll 5. Third roll - Final reroll 6. Choose a scoring category to mark on your score sheet The game ends when all players have filled all 13 categories on their score sheet. The player with the highest total score wins! HOW TO REROLL DICE After each roll, you'll see your current dice (for example: "1, 2, 4, 5, 6"). To reroll dice, type the specific dice you want to REROLL: - Type "16" to reroll one 1 and one 6 - Type "223" to reroll two 2s and one 3 - Type "4444" to reroll four 4s - Type "2" to reroll just one 2 (if you have "2, 2, 3, 4, 5") - Press Enter with no input to keep all dice (skip remaining rolls) The game removes dice one at a time as you type them, so you can reroll specific quantities SCORING CATEGORIES Upper Section (1s through 6s): 1, 2, 3, 4, 5, 6 - Sum of all dice showing that number Example: Roll 2, 2, 3, 2, 5 and choose "2s" = 6 points (2+2+2) Bonus: If upper section totals 63+ points, earn 35 point bonus Lower Section (special combinations): 3 of a kind (#) - At least 3 dice the same = sum of ALL dice 4 of a kind ($) - At least 4 dice the same = sum of ALL dice Full House (F) - 3 of one number + 2 of another = 25 points Small Straight (S) - Sequence of 4 dice (1234, 2345, or 3456) = 30 points Large Straight (L) - Sequence of 5 dice (12345 or 23456) = 40 points Yahtzee (Y) - All 5 dice the same = 50 points (additional Yahtzees = 100 points each!) Chance (C) - Any combination = sum of all dice SELECTING A SCORING SLOT After your final roll, choose where to score by pressing: 1-6 - Number categories (1s, 2s, 3s, 4s, 5s, 6s) # - Three of a kind $ - Four of a kind F - Full house S - Small straight L - Large straight Y - Yahtzee C - Chance Important: Each category can only be used once per game. If you don't match a category's requirements, you'll score 0 points for that category. STRATEGY TIPS - Try to get the upper section bonus (63+ points) by maximizing high numbers (4s, 5s, 6s) - Keep pairs and three-of-a-kind when going for Full House or Yahtzee - Watch for straight possibilities (consecutive numbers) - Save Chance for when nothing else scores - The CPU opponent uses smart strategy - it keeps multiples and potential straights, and prioritizes high-value scoring categories CPU OPPONENT When playing against the CPU (default mode), the computer will: - Automatically decide which dice to reroll based on the current hand - Choose the best available scoring category - Display its decisions so you can see what it's doing EXAMPLE TURN Roll 1: "2, 2, 3, 5, 6" - Keep the pair of 2s, reroll the others - Type: "356" and press Enter (rerolls the 3, 5, and 6) Roll 2: "2, 2, 2, 4, 6" - Nice! Three 2s. Keep them, reroll the 4 and 6 - Type: "46" and press Enter (rerolls the 4 and 6) Roll 3: "2, 2, 2, 2, 5" - Four of a kind! Sum = 2+2+2+2+5 = 13 - Press "$" to score 13 points in the 4-of-a-kind category REQUIREMENTS - bash 4.0 or higher - sox (for sound effects) - rolldice utility Have fun and may the dice be in your favor!