Skip to content

Instantly share code, notes, and snippets.

@jccc
Created October 29, 2010 02:03
Show Gist options
  • Select an option

  • Save jccc/652746 to your computer and use it in GitHub Desktop.

Select an option

Save jccc/652746 to your computer and use it in GitHub Desktop.
(defn rand-inst []
(let [ops '("add" "sub" "mul" "div" "cpy" " > ")
regs '(0 1 2 3)]
(list (rand-nth ops) (rand-nth regs)
(rand-nth regs)
(rand-nth regs))))
(defn gen-rand [size]
(for [n (range 0 size)]
(rand-inst)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment