Skip to content

Instantly share code, notes, and snippets.

@coffindragger
Created February 22, 2012 06:46
Show Gist options
  • Select an option

  • Save coffindragger/1882528 to your computer and use it in GitHub Desktop.

Select an option

Save coffindragger/1882528 to your computer and use it in GitHub Desktop.
artificial life programming game
(NRG > 6000) # if have over 6000 nrg
[reproduce 50] # reproduce giving 50% to child
[turn -15] # turn 15 degrees after spawning
(EYE.5 > 0) # there is something directly in front of us
shoot(-1)
# follow something
(EYE.4 > 0)
turn(10)
(EYE.6 > 0)
turn(-10)
An organism has DNA code, and Biological Memory.
DNA code is a series of if conditions and bodies, a sort of switch statement evaluated every cycle.
Sensory organs are read from locations in memory and Muscles are operated by writing to locations in memory.
# Simple Bot (http://wiki.darwinbots.com/w/Simple_Bot)
# a simple search pattern
(EYE.3 > EYE.5)
[aimdx -25]
(EYE.7 > EYE.5)
[aimdx 25]
# move forward
() # all genes must have a condition
[up 5]
# shoot food in front of us
(EYE.5 > 40)
[shoot -1]
(NRG > 5000)
[reproduce 50]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment