Lecture 15: May 28, 2024
Reading: zyBooks text, §2.10, 2.19, 3.13, 3.14, 8.5, 10.8
Assignments: Homework 3, due May 29 (Note extension); Extra Credit 2, due May 29 (Note extension)
- Random and pseudorandom number generation
- Pseudorandom numbers vs. random numbers
- Pseudorandom number generators rand, random [prand1.c, prand2.c]
- Seeding a pseudorandom number generator [prand1.c]
- Obtaining random numbers [rand.c]
- String functions [strings.c]
- Copy, compare sequential bytes in memory [mem.c]
- Math functions [mhodge.c]
- Buffer overflow on the stack [bad2.c]
- Writing a program with random numbers
- Monty Hall problem [monty1.c]
- Basic program, human does all selection of doors [monty2.c]
- Fix bug and simplify calculation of win/lose [monty3.c]
- Add randomness [monty4.c]
- Delete Monty showing user a door [monty5.c]
- Change main to determine whether switching wins or loses [monty6.c]
- Clean up, and add clearer output at the end [monty7.c]
- Make the number of rounds a macro [monty8.c]
- Let user specify number of games on the command line [monty9.c]