80 likes | 227 Vues
This document outlines the command line interface for running the Monopoly game simulation in Java. It provides options for configuring gameplay, including the number of games, players, rounds, and bankruptcy conditions. The default settings can be adjusted for a customized experience. The report generation feature offers detailed statistics on player performance, including income, expenses, and properties owned. Helpful error messages guide users to correct input parameters. This system aims to facilitate a structured and enjoyable virtual Monopoly experience.
E N D
Interface for command line usage java .\Monopoly -h Usage: Monopoly [options] options: -gNUM Play NUM games with the same set of rules. By default, NUM is 1. -pNUM Play each game with NUM players, where NUM is an integer from 2 to 6 inclusive. By default, NUM is 2. -rNUM Play at most NUM rounds. A negative number indicates that the game will continue until only 1 player is left. By default, NUM is -1. -bNUM game ends when NUM players go bankrupt. By default, NUM is 1. -j Causes players to not receive rent while in jail. -h Display this help and exit.
Restriction on Input Parameters For integers g, p, r, b: g ∈ [1, INT_MAX] Error message: g must be a positive integer p ∈ [2, 6] Error message: p must be an integer between 2 and 6 inclusive r ∈ [INT_MIN, INT_MAX] Error message: r must be an integer b ∈ [p-1, 5] Error message: b must be between 1 and p-1 ({p-1}) inclusive
Interface for command line usage java .\Monopoly –g 3 –p 3 –b 3 -j b must be between 1 and p-1 (2) inclusive java .\Monopoly –g 3 –p 3 –b 2 -j Ends when 2 players declare bankruptcy Jail rules activated Game 1 started Game 1 completed Game 2 started Game 2 completed Game 3 started Game 3 completed Collecting statistics and producing report
Report Format The following slide shall be the report format for each game played. All games played shall be put into one single report output. All report output will be directed to stdout.
###################################### Game <game#> report <designated flags set during at command line> ###################################### Per Player Statistics -------------------------------------------------- Player# | 1 | 2 | 3 | -------------------------------------------------- Rounds in game | 41 | 1 | 12 Max Money | $41 | $2 | $11 Net Income | $41 | $3 | $10 Total Expenses | $41 | $4 | $9 Highest Net Worth | $41 | $5 | $8 Highest Gross Income | $41 | $6 | $7 # of Property Groups Owned | 41 | 7 | 6 Times In Jail | 41 | 8 | 5 Total Cards Drawn | 41 | 9 | 4 Houses Purchased | 41 | 10 | 3 Hotels Purchased | 41 | 11 | 2 Doubles Rolled | 41 | 12 | 1 Game statistics ------------------------------------- Average money in player hand: <Average Amount Total Net Income> Number of times properties were mortgaged: <Amount Mortgaged> Number of times properties were unmortgaged : <Amount Unmortgaged>
Game space(board order) Total # times landed on ----------------------------------------------------------------------- <board space> <# of time landed on> Game space(descending order) Total # times landed on ------------------------------------------------------------------------------ <board space> <times landed on> Property that collected the most rent: <Property Name> ------------------------------------------------------ Property Group that collected the most rent: <Property Group> ------------------------------------------------------------- Listing of properties owned by player ------------------------------------- Player: <Player#> ------------------------------------- <Properties owned>