# 100 Gefangene (einfache Lösung)
#random

n    = 15     # Anzahl Gefangener

seen = 1      # Anzahl Seelen, die die Zählerin gesammelt hat
dropped = {}  # Gedächtnis der Drohnen, ob sie ihre Seele schon
              # abgegeben haben

bulb = False  # Zustand der Glühbirne (an/aus)

while True:
    randomPrisoner = roll(sides=n)
    if randomPrisoner == 1:
        if bulb:
            bulb = False
            seen = seen + 1
        if seen == n:
            break
    else:
        if not bulb and not randomPrisoner in dropped:
            dropped[randomPrisoner] = True
            bulb = True

b143c32b410690c1ad1610f8332d64c675c95bb8
<mask token>

<mask token>
while True:
    randomPrisoner = roll(sides=n)
    if randomPrisoner == 1:
        if bulb:
            bulb = False
            seen = seen + 1
        if seen == n:
            break
    elif not bulb and not randomPrisoner in dropped:
        dropped[randomPrisoner] = True
        bulb = True

n = 15
seen = 1
dropped = {}
bulb = False
while True:
    randomPrisoner = roll(sides=n)
    if randomPrisoner == 1:
        if bulb:
            bulb = False
            seen = seen + 1
        if seen == n:
            break
    elif not bulb and not randomPrisoner in dropped:
        dropped[randomPrisoner] = True
        bulb = True

# 100 Gefangene (einfache Lösung)
#random

n    = 15     # Anzahl Gefangener

seen = 1      # Anzahl Seelen, die die Zählerin gesammelt hat
dropped = {}  # Gedächtnis der Drohnen, ob sie ihre Seele schon
              # abgegeben haben

bulb = False  # Zustand der Glühbirne (an/aus)

while True:
    randomPrisoner = roll(sides=n)
    if randomPrisoner == 1:
        if bulb:
            bulb = False
            seen = seen + 1
        if seen == n:
            break
    else:
        if not bulb and not randomPrisoner in dropped:
            dropped[randomPrisoner] = True
            bulb = True
