Skip to content

Instantly share code, notes, and snippets.

@postspectacular
Created December 30, 2015 15:31
Show Gist options
  • Save postspectacular/b3906ab819fdc916ca32 to your computer and use it in GitHub Desktop.
Save postspectacular/b3906ab819fdc916ca32 to your computer and use it in GitHub Desktop.
HOLO2 - Random generated Barricelli reproduction function
;; pretty printed randomly generated reproduction function
;; x = position in curr. generation
;; y = generation
;; gene = value at (x,y)
(set-cell
x y
(if (and (prob (abs-sin (* x (+ 0.70618 (/ y 4.62437)))))
(pos? (dist x y 0 (- (sq (>> y 3.39245))))))
(mod (+ (+ gene (sin (* y 0.11592)))
(* 0.05011 (+ (gene-at x y -3 0) (gene-at x y 3 0))))
(max (gene-at x y -3 0) (gene-at x y 3 0)))
0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment