linesguy

Next nearest neighbour CA

Mar 29th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. 0 rem Full name: 1D Next nearest neighbour cellular automata (rule 11000011101111001110001110010000)
  2.  
  3. 10 hgr2 : for re = 1 to peek(78) : er = rnd(1) : next
  4. 13 for X = 2 to 277 : hcolor = int(rnd(1)*2)*3 : hplot X,0 : next
  5. 16 hcolor = 3 : hplot 0,0 to 0,191 : hplot 1,0 to 1,191
  6. 20 for Y = 0 to 190
  7. 30 for X = 2 to 277
  8.  
  9.  
  10. 999 rem And now for the real brains of this program:
  11. 1000 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  12. 1001 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  13. 1002 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  14. 1003 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  15. 1004 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  16. 1005 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  17. 1006 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  18. 1007 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  19. 1008 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  20. 1009 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  21. 1010 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  22. 1011 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  23. 1012 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  24. 1013 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  25. 1014 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  26. 1015 if hscrn(X-2,Y) = 3 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  27. 1016 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  28. 1017 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  29. 1018 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  30. 1019 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  31. 1020 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  32. 1021 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  33. 1022 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  34. 1023 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 3 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  35. 1024 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 3 : hplot X,Y+1 : goto 1032
  36. 1025 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  37. 1026 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  38. 1027 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 3 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 3 : hplot X,Y+1 : goto 1032
  39. 1028 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  40. 1029 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 3 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  41. 1030 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 3 then hcolor = 0 : hplot X,Y+1 : goto 1032
  42. 1031 if hscrn(X-2,Y) = 0 and hscrn(X-1,Y) = 0 and hscrn(X,Y) = 0 and hscrn(X+1,Y) = 0 and hscrn(X+2,Y) = 0 then hcolor = 0 : hplot X,Y+1 : goto 1032
  43. 1032 next : next
Advertisement
Add Comment
Please, Sign In to add comment