MVLib - Short Writeup - Version 4.0 Example Number 38 - Cellular Automata |
This example show hout to use the subroutines cellularrule, cellularplot,
cellularcycle and cellularplot; the application shows how to use the
the rules of Chris Lengton "Game of Life"
The fortran code is available here and the complete script running the code is available here. |
|||||||
![]() |
||||||||
| ||||||||
implicit none integer nx,ny,ic,jc parameter (nx=90,ny=90) ; integer m(nx,ny) character file*20,titolo*20 call cellularrule (-1,0) m=0 call mvsetflags('X size',600.0) do ic=18,72,9 ; do jc=18,72,9 call cellularinit(m,nx,ny,1,ic,jc) enddo ; enddo call cellularplot(m,nx,ny) call produciplot ('tmp000.gif',' ','Cycle n: 0') do ic=1,13 call cellularcycle(m,nx,ny) call cellularplot(m,nx,ny) call makefilename('tmp',ic,'.gif',file) write(titolo,'(a,i3)') 'Cycle n:',ic call produciplot (file,' ',titolo) enddo call viacolvento('tmp*.gif','example381.gif') end |