Jump to content
Science Forums

Recommended Posts

Posted
wow and all that produces a pretty light show :naughty: what made you do it?

 

Just thinking that over actually. I believe I read about them in Steven Levy's book Artificial Life. The (cellular automatons) are a form of artificial life.

I though maybe I'd start a thread in math on them, but now I think I like hiding this in here. Doesn't come up on the recent list for one. And the title doesn't give it away either!:eek2:

I know Pyrotex mentioned a 2-dimensioanl cellular automaton called Life, discovered by...I forget just now...oh Conway is it. Him & his buddies in the staff office of a university.

Anyway, I followed the descriptiuon in Levy's book & started programming them to play with. A 1X3 is relatively simple, but a 1X4 or 1X5 get very complex very quickly.

That is all.:evil: :confused:

Except PS. I have inferred from your comment JQ that you succesfully retrieved the program so I must have succesfully transmitted it. This concludes this part of our trst.

Posted
yes I did succesfully retrieve it, and it even played full screen :D

 

I have to laugh because the 'full screen feature' is actually Basic's CLS (clearscreen) command taking over the whole works. This is why I kept emphasizing F10 to stop, because I have had to reboot before to get control back (I forgot the key myself for awhile)

I'll check my archive where I found it & see if I still have the 1X4 & 1X5 versions. If I do, they won't have menus either. I haven't had this stuff out for 5 to 7 years I think! Deja voodoo.:evil: :eek2: :evil: :) :naughty: :) :confused: :( ;) :D :)

Posted

Oh also I remembered that I coded the different colors to try & see what effect particular rule changes were having in the overall pattern. I basically stuck with one set of initial condition & tweeked the rule sets. :naughty: :confused:

Posted

F10 is not the only way out, i ctrl+alt+deleted it so i could see how much of my processor it was using - its a fairly light program(on my comp) I half expected all the calculations to make my cpu run overtime..:confused: ohwell like you said it was a little while ago now - any computers would have come along way!

Posted
F10 is not the only way out, i ctrl+alt+deleted it so i could see how much of my processor it was using - its a fairly light program(on my comp) I half expected all the calculations to make my cpu run overtime..:confused: ohwell like you said it was a little while ago now - any computers would have come along way!

 

Glad for the feedback on another way out. This software (TurboBasic from Borland) I bought & ran originally on an 8088 clone running DOS. Amazing how it still works for sure!

Garbage day tomorrow so I have to haul it to the curb. I'll check in later. Thanks for the interest JQ!:naughty:

Posted
F10 is not the only way out, i ctrl+alt+deleted it so i could see how much of my processor it was using - its a fairly light program(on my comp)

 

I tried that interupt method JQ, & not only did it stop it, it kept it open on the bar & holding its current state. I then was able to restart it. I was at about 80,000 cycles. Then I killed it. It was alive; now its not.:shrug:

But...since you can't change any parameters with the .exe file, everytime you run it, it will be exactly the same.

Now suppose we leave the rules the same, & change just one cell in the initial line. Now, it will have a similar appearance (triangally) but it will be completely different in its specifics.

When (if?) we get to more complex systems, the patterns start doing more than triangally stuff. Also, you have thousands & thousands of possible rule sets!

Up up & away,

we're testing today.

Please put your books & papers under your desk & take out a #2 pencil.:hyper:

Posted

so hows your programing turtle? you could create a GUI that allowed the user to select from different rules and click a button to randomise the initial conditions (first line). Then when the it is done drawing the first screen then you could export it to a .jpg file... still going up :shrug:

Posted
so hows your programing turtle? you could create a GUI that allowed the user to select from different rules and click a button to randomise the initial conditions (first line). Then when the it is done drawing the first screen then you could export it to a .jpg file... still going up :)

 

This old basic is the only programming language I have, and know how to write in for that matter. I can set up menuing options, & I think I have the 'Life' automaton in basic with menu for enetering starting conditions (for that automaton the rules don't change, just initial conditions.) It was just a few months ago that I saved these files from little floppies and got them on this machine, a 3 machine process for me.

Now that I know how to attach .exe files (thanks BD!) in zippered files I plan to go through them & see what I got. In the mean time, feel free to copy, modify, or translate to another program any of these automatons; they are no more mine than the right triangle belonged to Pythagoras.

That is all...for now.0.o

Posted
hmm I coulnt get that one to work.. but I thiink its a problem on my end not yours, something about my AUTOEXEC.NT not been valid :hihi:

 

I will check back later if I fix it up ;)

 

Acknowledged. In Windows 3.1 there was a setting somewhere to force the program to run in a window. I don't know where it is (or if it is) in current Windows.

Thanks for the feedback JQ:phones:

 

PS Here is the Basic code :) :eek_big:

 

'THE GAME OF LIFE

 

screen 1

color ,1

cls

option base 1

dim A(76,47)

dim B(76,47)

dim c(2)

dim temp(76,47)

defint d-r,x

 

'These functions convert input coordinates to graphic coordinates

'for use as subscripts in main arrays.

 

def fncolumn(q) = (q*4)+8

def fnrow(p) = (p*4)+3

 

'Enter starting pattern

print "The playing field is a grid 76 columns"

print "X 47 rows. Follow the prompts and enter"

print "the coordinates where you want to have"

print "a living cell. After you have completed"

print "your entries choose start the game. A"

print " beep will signal the end of each move."

print

print "Press any key to begin"

10 while inkey$=""

goto 10

wend

 

'Input loop

menu:

cls

locate 8,18

print "MENU"

locate 10,12

print "1) Add lives"

locate 12,12

print "2) Remove lives"

locate 14,12

print "3) Display grid"

locate 16,12

print "4) Begin play"

locate 18,12

print "5) End game"

locate 20,10

input "Choose a number ",choice

if choice < 0 or choice > 5 then goto menu

on choice gosub 20,40,30,50,70

goto menu

 

 

20 cls

print "Enter the column coordinate first,"

print "1 to 76, then the row (1 to 47), &"

print "seperate the entries with a space"

print "or comma. {Ex. 12,23 or 12 23}"

 

count=0

locate 10,10

input "Create a life at -- ",C,R

if C<1 OR C>76 then 80

if R<1 OR R>47 then 80

A(C,R) = 1

beep

print "Do you want to add another life?"

input "(y or n) ",reply$

if reply$ = "Y" or reply$ = "y" then 20 else return

 

'Display grid

30 cls

gosub grid

for p = 1 to 76

for q = 1 to 47

if A(p,q) = 1 then circle(fncolumn(p),fnrow(q)),1,1

next q

next p

32 while inkey$ = ""

goto 32

wend

' delay 5

return

 

'Remove a life

40 cls

locate 3,10

input "Remove a life at -- ",C,R

if C<1 OR C>76 then goto 85

if R<1 OR R>47 then goto 85

A(C,R) = 0

beep

print "Do you want to remove another?"

input "(y or n) ",reply$

if reply$ = "Y" or reply$ = "y" then 40 else return

 

 

 

50 cls

sound 95,1

$event on

on key (10) gosub 83

key (10) on

$event off

'beep

 

' display most recent grid & calculate new grid, beep & display new grid

gosub grid

for p = 1 to 76

for q = 1 to 47

if A(p,q) = 1 then circle(fncolumn(p),fnrow(q)),1,1

next q

next p

'delay 2

locate 22,5

print count

 

'# upper left corner #

if A(1,1)=0 AND A(1,2)+A(2,2)+A(2,1)=3 then B(1,1)=1 ELSE B(1,1)=0

if A(1,1)=1 AND (A(1,2)+A(2,2)+A(2,1)=2 OR A(1,2)+A(2,2)+A(2,1)=3) then B(1,1)=1 ELSE B(1,1)=0

 

'# row 1, columns 2 to 75 #

for j=2 to 75

if A(j,1)=0 AND A((j-1),1)+A((j-1),2)+A(j,2)+A((j+1),2)+A((j+1),1)=3 then B(j,1)=1 ELSE B(j,1)=0

if A(j,1)=1 AND (A((j-1),1)+A((j-1),2)+A(j,2)+A((j+1),2)+A((j+1),1)=2 OR A((j-1),1)+A((j-1),2)+A(j,2)+A((j+1),2)+A((j+1),1)=3) then B(j,1)=1 ELSE B(j,1)=0

next j

 

' # upper right corner #

if A(76,1)=0 AND A(76,2)+A(75,2)+A(75,1)=3 then B(76,1)=1 ELSE B(76,1)=0

if A(76,1)=1 AND (A(75,1)+A(75,2)+A(76,2)=2 OR A(75,1)+A(75,2)+A(76,2)=3) then B(76,1)=1 ELSE B(76,1)=0

 

' # left column #

for i = 2 to 46

if A(1,i)=0 AND A(1,(i-1))+A(2,(i-1))+A(2,i)+A(2,(i+1))+A(1,(i+1))=3 then B(1,i)=1 ELSE B(1,i)=0

if A(1,i)=1 AND (A(1,(i-1))+A(2,(i-1))+A(2,i)+A(2,(i+1))+A(1,(i+1))=2 OR A(1,(i-1))+A(2,(i-1))+A(2,i)+A(2,(i+1))+A(1,(i+1))=3) then B(1,i)=1 ELSE B(1,i)=0

next i

 

' # right column #

for i = 2 to 46

if A(76,i)=0 AND A(76,(i-1))+A(75,(i-1))+A(75,i)+A(75,(i+1))+A(76,(i+1))=3 then B(76,i)=1 ELSE B(76,i)=0

if A(76,i)=1 AND (A(76,(i-1))+A(75,(i-1))+A(75,i)+A(75,(i+1))+A(76,(i+1))=2 OR A(76,(i-1))+A(75,(i-1))+A(75,i)+A(75,(i+1))+A(76,(i+1))=3) then B(76,i)=1 ELSE B(76,i)=0

next i

 

' # Bot left corner #

if A(1,47)=0 AND A(1,46)+A(2,46)+A(2,47)=3 then B(1,47)=1 ELSE B(1,47)=0

if A(1,47)=1 AND (A(2,47)+A(2,46)+A(2,47)=2 OR A(2,47)+A(2,46)+A(2,47)=3) then B(1,47)=1 else B(1,47)=0

 

' # Bot right corner #

if A(76,47)=0 AND A(76,46)+A(75,46)+A(75,47)=3 then B(76,47)=1 ELSE B(76,47)=0

if A(76,47)=1 AND (A(76,46)+A(75,46)+A(75,47)=2 OR A(76,46)+A(75,46)+A(75,47)=3) then B(76,47)=1 ELSE B(76,47)=0

 

' # bot row #

for j=2 to 75

if A(j,47)=0 AND A((j-1),47)+A((j-1),46)+A(j,46)+A((j+1),46)+A(j,47)=3 then B(j,47)=1 ELSE B(j,47)=0

if A(j,47)=1 AND (A((j-1),47)+A((j-1),46)+A(j,46)+A((j+1),46)+A(j,47)=2 OR A((j-1),47)+A((j-1),46)+A(j,46)+A((j+1),46)+A(j,47)=3) then B(j,47)=1 ELSE B(j,47)=0

next j

 

' # rows & columns #

for j=2 to 75

for i=2 to 46

X=0

X = A(j,(i-1)) + A((j+1),(i-1)) + A((j+1),i) + A((j+1),(i+1)) + A(j,(i+1)) + A((j-1),(i+1)) + A((j-1),i) + A((j-1),(i-1))

 

if A(j,i)=0 AND X=3 then B(j,i)=1 ELSE B(j,i)=0

if A(j,i)=1 AND X>3 then B(j,i)=0

if A(j,i)=1 AND X<2 then B(j,i)=0

if A(j,i)=1 AND X=2 OR X=3 then B(j,i)=1

next i

next j

 

 

' * check to see if pattern has stabalized & advance count *

count = count + 1

for j = 1 to 76

for i = 1 to 47

if A(j,i)=0 AND B(j,i)=1 then 65

if A(j,i)=1 AND B(j,i)=0 then 65

next i

next j

 

 

60 locate 24,1 :print "Pattern has stabalized at ";count "iterations."

print "press any key to return to menu."

62 while inkey$ = ""

goto 62

wend

goto menu

 

' * puts array B into array temp *

65 for j = 1 to 76

for i = 1 to 47

temp(j,i) = B(j,i)

next i

next j

 

' * resets elements in arrays A & B to 0 *

for j = 1 to 76

for i = 1 to 47

B(j,i) = 0

A(j,i) = 0

next i

next j

 

' * puts array temp into array A *

for j = 1 to 76

for i = 1 to 47

A(j,i) = temp(j,i)

next i

next j

' * resets elements in array temp to 0 *

for j = 1 to 76

for i = 1 to 47

temp(j,i) = 0

next i

next j

 

goto 50

 

70 END

 

 

'Draw grid

GRID:

for i=10 to 318 step 4

line(i,5)-(i,192),2

next i

for j=5 to 196 step 4

line(10,j)-(318,j),2

next j

return

 

80 locate 15,3

print "You have made an entry error."

print "The range is 76 columns X 47 rows."

print "Strike a key to return"

82 while inkey$=""

goto 82

wend

goto 20

 

83 while inkey$=""

goto 83

wend

return

 

85 locate 15,3

print "You have made an entry error."

print "The range is 76 columns X 47 rows."

print "Strike a key to return"

87 while inkey$=""

goto 87

wend

goto 40

Posted
umm... yeah!

 

and what exactly is that?

 

Just another test:) Off to study. But first...I have to find another post worthy of deletion so I can put a new tiling in the Gallery which counts as a post but I want (need!?) to stay at 3773 posts. Riiiiight....:eek2: :doh: :hihi: ;) :eek: :umno: ;) :) :Alien: :) :evil: :wink: :evil:

mission successful

 

..and the all important question, what is so special about the number 3773?

It's a base ten palindrome. GETE

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...