# Tactiverge Academy — companion code for "Randomisation, blinding and bias"
# Lesson: https://tactiverge.win/academy/research-methodology/experimental-design/randomisation-and-bias/
# Licence: MIT (see https://tactiverge.win/open-engineering/). Examples appear in lesson order.

# ── Example 1 ────────────────────────────────────────
import random

random.seed(2026)   # record the seed so the order can be reproduced
conditions = ["vision", "force", "fusion"]
blocks = 4

schedule = []
for b in range(blocks):
    block = conditions[:]        # copy the list
    random.shuffle(block)        # new random order in every block
    schedule.extend(block)

for i, c in enumerate(schedule, start=1):
    print(i, c)
