I am creating a college basketball simulation that uses statistics to simulate games. Ultimately, going to buy a GUI interface on top of it, and create a management game.
Each game is simulated via a state machine, essentially. Could also be done in a while loop just as effectively. Anyways, I am having trouble with the clock mechanism. How and when does the game stop? There is two 20 minute halves in college basketball. The most reasonable method I could come up with is as follows:
You initialize a variable to 20 minutes (12,000 deciseconds). Then, each basektball posession is given a randomized length of posession off of a bell curve, centered around the teams average posession length. Each time, this amount is deducted from the initialized time variable until it reaches zero.
What do you guys think? Can anyone think of a more accurate clock representation?