Hacker News new | ask | show | jobs
by ansk 416 days ago
And on the seventh day, God ended His work which He had done and began vibe coding the remainder of the human genome.
1 comments

this should do the trick...

  while creatures:
    c = get_random_creature()
    if c.is_dead():
      creatures.pop(c)
    else:
      creatures.add(c.mutate())
You also need selection, not just mutation (I know you are being silly, so am I)
Selection is handled by asynchronous events which populate the is_dead() boolean.

Critiquing my own code, though, it should really be a check against 'can_reproduce()' rather than 'is_dead()'.