Skip to content
CCC Python Course

Simulation

Stage
2
Module
M2.3
Lessons
1

In this module

  • Model a process literally, one step at a time, with a variable for each piece of state.
  • Recognize when a problem's story is the algorithm, needing no extra insight beyond following it exactly.
  • Check a simulation's result against a hand-worked run of the same steps.

Before this module

Lessons

  1. 1Simulation

Practice

Try these on the judges. Each link opens the problem on WMOJ or DMOJ.

  1. 2026 J3
    Creative Candy Consumption (opens on WMOJ in a new tab) WMOJ

    Two lines of candies face off by fixed rules until one line empties; find how many each side ate.

  2. 2014 J3
    Double Dice (opens on DMOJ in a new tab) DMOJ

    Track two players' scores through a dice game, round by round.

    Why DMOJ: An early Junior problem, included here for extra practice.

  3. 2015 J4
    Wait Time (opens on DMOJ in a new tab) DMOJ

    Find how long you kept each friend waiting for a reply, from a log of messages.

    Why DMOJ: A Junior problem, included here for extra practice.