Loops and simulation · 2 of 2
Simulation
Carry out a process step by step: keep its state, apply each step in the right order, move on a grid with direction arrays, and skip ahead when the steps repeat.
- Simulation Shell Game and Mixing Milk worked through, then graded Bronze simulation problems to practise on. usaco.guide (opens in a new tab)
- Cycle detection The tail and loop of a repeating sequence, the shape Mixing Milk takes, found with Floyd’s or Brent’s algorithm in constant memory. en.wikipedia.org (opens in a new tab)
- 模拟 (Simulation) Advice for long simulations: plan on paper, split the code into functions and debug each part separately. oi-wiki.org (opens in a new tab)