scroll-and-morph


Information

Created with NetLogo version NetLogo 4.0beta3
Running with NetLogoLite.jar version 404.


USES the WITH-HACK

Procedures

NetLogo Version: NetLogo 4.0beta3

globals [ dir ]
patches-own [ ncolor rrggbb rr gg bb]


to setup
   ask-in-order patches with [ do-set-pcolor (5 + 10 * random 14) ]
   set dir [ 0 1 ]
end

to test
   if random 1000 < 20 [ set dir one-of [ [ 0 1 ] [ 1 0 ] [ -1 0 ] [ 0 -1 ] ] ]
   ask-in-order patches with [ do-scroll-color ]
   ask-in-order patches with [ do-set-pcolor ncolor ]
   ask-in-order patches with [ do-morph-color ]
   tick
end

to ask-in-order [ ## ]
end

to-report do-set-pcolor [ hue ]
   set pcolor hue
   report false
end      

to-report do-scroll-color
   set ncolor [pcolor] of patch-at first dir last dir
   report false
end

to-report do-morph-color
   set pcolor ( 10 * floor (pcolor / 10)) + min (list 9.9 ((pcolor + 1) mod 10)) 
   report false
end

     

                    


Download Link

View or download the complete model file (to download: right-click, save-link-as):
-- Download scroll-and-morph --