Questions about anything at all?
Where we are :
Today : practice.
Chapter 9 is called "simulation and design" ... which discusses some ideas behind the practice of writing software. Please read that chapter.
We'll be discussing in class some of those ideas over the next week or so.
Our goal today is to write together as a group a program that simulates the game of craps, and in particular estimates the odds of winning at craps.
See for example wikipedia - craps - rules of play for what exactly it means to "win at craps".
Writing software ideas (some from chapter 9) :
So let's do this together.
What we ended up with is the attached craps.py.
$ python craps.py
-- Compute winning probability for craps --
How many games? (^d to exit) 100000
You won 49286 games out of 100000 which is an average of 0.4929
```
last modified | size | ||
craps.py | Sun Dec 22 2024 02:00 pm | 2.3K |