/** * CS 231 — Project 1 * Simulation * * Purpose: * Runs repeated Blackjack games and reports the percentage of player wins, * dealer wins, and pushes (ties). */ public class Simulation { public static void main(String[] args) { // TODO: Choose the number of games for this experiment. // // You will run three experiments for your report: // 100 games // 1,000 games // 10,000 games // // You may run these experiments separately. int numGames = 100; // TODO: Create one Blackjack object and reuse it throughout // this experiment. // TODO: Create integer variables to count: // - player wins // - dealer wins // - pushes (ties) // TODO: Run numGames games. // // For each game: // 1. Call game(false). // 2. Use the returned value to update the appropriate counter. // 3. Call reset() before starting the next game. // // game(false) returns: // -1 dealer win // 0 push (tie) // 1 player win // TODO: Calculate the percentage of each outcome. // // Be careful about integer division when calculating percentages. // TODO: Print: // - the number of games simulated // - player win percentage // - dealer win percentage // - push (tie) percentage } }