Advertisement
ashleymartin

Untitled

Jun 10th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. CenterList[n_Integer] := ReplacePart[Table[0, {n}], 1, Ceiling[n/2]]
  2. ElementaryRule [num_Integer] := IntegerDigits[num, 2, 8]
  3. CAStep[rule_, a_List] := Partition[a, 3, 1, 2] /. rule
  4. CAEvolveList[rule_List, init_List, t_Integer] :=
  5. NestList[CAStep[rule, #] &, init, t]
  6. Show[
  7. CAGraphics[CAEvolveList[ElementaryRule[30], CenterList[103], 50]]]
  8.  
  9. Instead of the ElementaryRule30 option I want to use my pattern code, the one I defined in the first question.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement