Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0 rem This program was derived from the next-nearest-neighbour-cellular-automata
- 2 width = 10 : rem max 277
- 5 BA = 0 : rem if 1, Then it will draw bars around each pattern, Apparently not needed for most patterns.
- 10 hgr : onerr goto 9999
- 11 rule$ = "" : for x = 1 to 40 : print : next : print "Rule:" : for re = 1 to peek(78)+peek(78)+peek(78)+peek(78) : er = rnd(1) : next : for re = 1 to 32 : rule$ = rule$ + str$(int(rnd(1)*2)) : next
- 12 rem Rule$ = ""
- 13 print rule$ : for X = 2 to width : hcolor = int(rnd(1)*2)*3 : hplot X+x2,0 : next
- 16 hcolor = 3
- 17 if ba = 1 then hplot 0+x2,0 to 0+x2,100 : hplot 1+x2,0 to 1+x2,100
- 18 if ba = 1 then hplot width+1+x2,0 to width+1+x2,100 : hplot width+2+x2,0 to width+2+x2,100
- 20 for Y = 0 to 99
- 30 for X = 2+x2 to width+x2
- 1000 if hscrn(X-2,Y) = 3 then goto 2000
- 1010 goto 2020
- 2000 if hscrn(X-1,Y) = 3 then goto 3000
- 2010 goto 3020
- 2020 if hscrn(X-1,Y) = 3 then goto 3040
- 2030 goto 3060
- 3000 if hscrn(X,Y) = 3 then goto 4000
- 3010 goto 4020
- 3020 if hscrn(x,y) = 3 then goto 4040
- 3030 goto 4060
- 3040 if hscrn(x,y) = 3 then goto 4080
- 3050 goto 4100
- 3060 if hscrn(x,y) = 3 then goto 4120
- 3070 goto 4140
- 4000 if hscrn(X+1,Y) = 3 then goto 5000
- 4010 goto 5020
- 4020 if hscrn(X+1,Y) = 3 then goto 5040
- 4030 goto 5060
- 4040 if hscrn(x+1,y) = 3 then goto 5080
- 4050 goto 5100
- 4060 if hscrn(x+1,y) = 3 then goto 5120
- 4070 goto 5140
- 4080 if hscrn(x+1,y) = 3 then goto 5160
- 4090 goto 5180
- 4100 if hscrn(x+1,y) = 3 then goto 5200
- 4110 goto 5220
- 4120 if hscrn(x+1,y) = 3 then goto 5240
- 4130 goto 5260
- 4140 if hscrn(x+1,y) = 3 then goto 5280
- 4150 goto 5300
- 5000 if hscrn(X+2,Y) = 3 then hcolor = val(mid$(rule$,1,1))*3 : hplot X,Y+1 : goto 6000
- 5010 hcolor = val(mid$(rule$,2,1))*3 : hplot X,Y+1 : goto 6000
- 5020 if hscrn(X+2,Y) = 3 then hcolor = val(mid$(rule$,3,1))*3 : hplot X,Y+1 : goto 6000
- 5030 hcolor = val(mid$(rule$,4,1))*3 : hplot X,Y+1 : goto 6000
- 5040 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,5,1))*3 : hplot x,y+1 : goto 6000
- 5050 hcolor = val(mid$(rule$,6,1))*3 : hplot X,Y+1 : goto 6000
- 5060 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,7,1))*3 : hplot x,y+1 : goto 6000
- 5070 hcolor = val(mid$(rule$,8,1))*3 : hplot X,Y+1 : goto 6000
- 5080 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,9,1))*3 : hplot x,y+1 : goto 6000
- 5090 hcolor = val(mid$(rule$,10,1))*3 : hplot X,Y+1 : goto 6000
- 5100 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,11,1))*3 : hplot x,y+1 : goto 6000
- 5110 hcolor = val(mid$(rule$,12,1))*3 : hplot X,Y+1 : goto 6000
- 5120 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,13,1))*3 : hplot x,y+1 : goto 6000
- 5130 hcolor = val(mid$(rule$,14,1))*3 : hplot X,Y+1 : goto 6000
- 5140 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,15,1))*3 : hplot x,y+1 : goto 6000
- 5150 hcolor = val(mid$(rule$,16,1))*3 : hplot X,Y+1 : goto 6000
- 5160 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,17,1))*3 : hplot x,y+1 : goto 6000
- 5170 hcolor = val(mid$(rule$,18,1))*3 : hplot X,Y+1 : goto 6000
- 5180 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,19,1))*3 : hplot x,y+1 : goto 6000
- 5190 hcolor = val(mid$(rule$,20,1))*3 : hplot X,Y+1 : goto 6000
- 5200 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,21,1))*3 : hplot x,y+1 : goto 6000
- 5210 hcolor = val(mid$(rule$,22,1))*3 : hplot X,Y+1 : goto 6000
- 5220 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,23,1))*3 : hplot x,y+1 : goto 6000
- 5230 hcolor = val(mid$(rule$,24,1))*3 : hplot X,Y+1 : goto 6000
- 5240 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,25,1))*3 : hplot x,y+1 : goto 6000
- 5250 hcolor = val(mid$(rule$,26,1))*3 : hplot X,Y+1 : goto 6000
- 5260 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,27,1))*3 : hplot x,y+1 : goto 6000
- 5270 hcolor = val(mid$(rule$,28,1))*3 : hplot X,Y+1 : goto 6000
- 5280 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,29,1))*3 : hplot x,y+1 : goto 6000
- 5290 hcolor = val(mid$(rule$,30,1))*3 : hplot X,Y+1 : goto 6000
- 5300 if hscrn(x+2,y) = 3 then hcolor = val(mid$(rule$,30,1))*3 : hplot x,y+1 : goto 6000
- 5310 hcolor = val(mid$(rule$,32,1))*3 : hplot X,Y+1 : goto 6000
- 6000 next : next
- 7000 x2 = x2 + width+4 : goto 11
- 9999 end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement