logoalt Hacker News

sdenton4 • 04/22/2025 • 1 reply • view on HN

this should do the trick...

  while creatures:
    c = get_random_creature()
    if c.is_dead():
      creatures.pop(c)
    else:
      creatures.add(c.mutate())

Replies

RogerL • 04/22/2025

You also need selection, not just mutation (I know you are being silly, so am I)

➕ show 1 reply