LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our General Code Repository Files. Also, before posting here, check to see if your post doesn't fit into another subforum by category.


Tags
(This content has not been tagged yet)
2 Pages V   1 2 >  
Reply to this topic Start new topic
> [CR] Game of Life
eaolson
post Jul 10 2007, 11:21 AM
Post #1


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


File Name: Game of Life File Submitter: eaolson File Submitted: 4 Jul 2007 File Updated: 14 Mar 2008 File Category: General File Version: 1.1.1 LabVIEW Version: 7.1.x License: Other (included with download) Game of Life V1.1.1 Copyright © 2007, All rights reserved. Author: Eric Olson eaolson@illicom.net Distribution: This code was downloaded from the LAVA Code Repository: http://forums.lavag.org/downloads.html Description: Conway's Game of Life is a fun little simulation of a group of cells. How new cells are born and how old cells die is decided by a simple set of rules, but can lead to complicated behavior by the entire colony. I've always found this simulation to be interesting and I thought coding it in LabVIEW would be a fun exercise. Comments and critiques of either the game or of my coding style are always welcome. The basic rules are simple: 1. A cell that has one or zero neighbors dies of lonliness. 2. A cell that has four or more neighbors dies of overcrowding. 3. An empty cell that has exactly three neighbors containes a new cell in the following generation. A thorough explanation of the Game can be found at http://en.wikipedia.org/wiki/Conway%27s_game_of_life . Dependancies: This uses the OpenG time, file, and variantconfig libraries. They are not included. Download them via the OpenG Package Manager: http://forums.jkisoft.com/index.php?showtopic=233 Support: If you have any problems with this code or want to suggest features: http://forums.lavag.org/CR-Game-of-Life-t8616.html Change Log: 1.0.0: Initial release of the code. 1.0.1: Include readme.txt in the zip file. 1.1.0: Added Open and Save As functions (in the menubar). Added an About dialog. Removed the Exit button (redundant to Close). 1.1.1: Forgot to include the .rtm file in the distribution. Rows/columns now update when opening a .gol file. License: This is released under the Creative Commons Attribution-Share Alike 3.0 License. http://creativecommons.org/licenses/by-sa/3.0/ Click here to download this file


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Jul 10 2007, 11:21 AM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Yair
post Jul 10 2007, 04:58 PM
Post #2


Extwemely Active
*****

Premium Member
Posts: 1621
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


I like the idea. thumbup1.gif

I think I actually saw another version once on NI's site. It's probably still there.

--------------------
More than meets the eye...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jccorreu
post Jul 11 2007, 07:58 PM
Post #3


More Active
**

Member
Posts: 30
Joined: 15-June 07
Member No.: 8730
Using LabVIEW Since:2005
LV:7.1 ,. ,.
Nothing Selected Nothing Selected Nothing Selected


I've been really interested in complex systems for years. Read a few books, part of Wolframs New Science, and even own a couple. But I'd sort of forgotten about it the last couple years. Great reminder. If I can pull some time I might go back and program some of the others I've come across, to learn more LabView and more complexity.

I'd add the ability to save the initial state of the system. I've played with it a few times and had outcomes that I really found intriguing, but then couldn't replicate, simply cause I clicked wantonly to create the original state, and therefore not only couldn't remember, but didn't really know what I started with.

This post has been edited by jccorreu: Jul 11 2007, 08:06 PM

--------------------
--
"Advances are made by answering questions. Discoveries are made by questioning answers."
Bernard Haisch


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
h1voltage
post Jul 12 2007, 05:16 PM
Post #4


Active
*

Member
Posts: 21
Joined: 17-April 06
Member No.: 4775
Using LabVIEW Since:2005
LV:8.2.1 ,8.0.1 ,7.1
United States Nothing Selected Nothing Selected


Nice work! Very interesting to play with. I have read a little about complex systems as well. Any readings you have found particularly interesting?

This post has been edited by h1voltage: Jul 12 2007, 05:16 PM


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jccorreu
post Jul 31 2007, 05:28 PM
Post #5


More Active
**

Member
Posts: 30
Joined: 15-June 07
Member No.: 8730
Using LabVIEW Since:2005
LV:7.1 ,. ,.
Nothing Selected Nothing Selected Nothing Selected


Lets see...
there was Ludwig von Bertalanffy's "General Systems Theory". written decades ago, he was one fo the founding fathers of systems approach. It can get kind of statisical sometimes, but is really good at expressing the overlap that exists amongst fields, in the sense that patterns re-appear everywehere we look.

Roger HIghfields "Frontiers of Complexity" Shows some if cellular automata research and results, and also how there is overlap amongst fields

M Mitchel Waldrup "Complexity: Emerging Science.." this goes into the establishment of the Santa Fe institute, and how scientisit of differnet fields got together to teach each other what they were doing, and that they saw things the others already knew that could aid them in their own endeavors, again across fields. It thereofre also notes the repeating patterns throughout nature and human knowledge.


And while I was playing with this, watching the evolution I jotted down a number of ideas for how else to play:

instead of bouncing off the boarders, have option for them wrap around like a globe

instead of making the rules hardcoded, make the ability to easily define the rules

attempt to simulate civilization, stock market, ...
I always thought it'd be neat to make a civilization game whose engine was based on rules of cellular automata, instead of the normal way of setting the rules, maybe it would become more like nauter and a better simulaiton

save initial conditions, at stop ask if want to keep

make "rules" which evolve

option run "backwards"...
any one set of starting conditions should only have one ending condition, but any one ending condition could have many starting conditions? choices would have to be made as to which path to come from

for stagnation and repetition, forward and backward are the same

we seem to be saying with this game that the future can be predicted but the past can not be known, strange that is the reverse of what we usually think

hold down mouse and drag, left and right, one to turn on cells, the other to turn off

different regions of the board have different rules

different color cells have different rules

can add "pulses" during the running of process, or have the same thing repeatedly put in at regular intervals, or when statis occurs, etc..

only reproduce if you find a mate. based on cell color. the preferences can change as well, perhaps based on past experience.

--------------------
--
"Advances are made by answering questions. Discoveries are made by questioning answers."
Bernard Haisch


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
eaolson
post Aug 2 2007, 10:36 PM
Post #6


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


QUOTE (jccorreu @ Jul 31 2007, 12:28 PM) *
instead of bouncing off the boarders, have option for them wrap around like a globe

A globe would mean that the left and right edges of the board are connected, but not the top and bottom (i.e. you can't get to the South Pole be walking north from the North Pole.)

Trivia question: There is a shape described by a 2-D plane connected at the left and right edges and at the top and bottom edges. What is it?

One addition I do want to make is that of an "infinite" field. That is, when the population gets to the edge, the whole field enlarges itself to add empty rows/columns. Therefore, nothing would ever hit an edge.

QUOTE
instead of making the rules hardcoded, make the ability to easily define the rules

I would like to extend this to include different rulesets, but that's in the future.

QUOTE
I always thought it'd be neat to make a civilization game whose engine was based on rules of cellular automata, instead of the normal way of setting the rules, maybe it would become more like nauter and a better simulaiton

You may want to check out SimEarth. It's an old game from the 80s, but did a similar thing.

QUOTE
option run "backwards"...
any one set of starting conditions should only have one ending condition, but any one ending condition could have many starting conditions? choices would have to be made as to which path to come from

This isn't possible. For a given state, there are any number of possible states that lead to it. Think of an empty field, with all the cells dead. What lead to it, a similar empty field, or a field with one cell that died of loneliness?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Aug 2 2007, 11:06 PM
Post #7


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3740
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (eaolson @ Aug 3 2007, 08:36 AM) *
A globe would mean that the left and right edges of the board are connected, but not the top and bottom (i.e. you can't get to the South Pole be walking north from the North Pole.)

Yes, you can't get to the South Pole by walking north from the North Pole, but you also can't get to the East Pole by walking west from the West Pole smile.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
orko
post Aug 2 2007, 11:34 PM
Post #8


Extremely Active
****

Premium Member
Posts: 525
Joined: 18-October 05
From: Seattle, WA
Member No.: 3266
Using LabVIEW Since:2005
LV:8.5 ,8.2.1 ,7.1.1
United States us_washington Nothing Selected My Blog


QUOTE (eaolson @ Aug 2 2007, 03:36 PM) *
Trivia question: There is a shape described by a 2-D plane connected at the left and right edges and at the top and bottom edges. What is it?


mmmm...donut

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jccorreu
post Aug 3 2007, 12:26 AM
Post #9


More Active
**

Member
Posts: 30
Joined: 15-June 07
Member No.: 8730
Using LabVIEW Since:2005
LV:7.1 ,. ,.
Nothing Selected Nothing Selected Nothing Selected


DOH! Yes, simulating a globe would be slightly different. Now I think of it, the sims like civilization never actually emulated a globe, since technically that would mean portions of the top are connected with other portions of the side (er, I mean top, but that's a strange idea of a typo....), and likewise for the bottom. Might be neat action to add in also.

Strange I never heard of SimEarth, but looking it up on wikipedia makes it look quite intriguing to me. Of course, I doubt that its coded on the concepts of cellular automata, but who knows. I'll see if I can get a copy sometime and experiment. mwah, ha ha!

This post has been edited by jccorreu: Aug 3 2007, 12:42 AM

--------------------
--
"Advances are made by answering questions. Discoveries are made by questioning answers."
Bernard Haisch


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Aug 3 2007, 02:31 PM
Post #10


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3740
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (eaolson @ Aug 3 2007, 08:36 AM) *
Trivia question: There is a shape described by a 2-D plane connected at the left and right edges and at the top and bottom edges. What is it?

A torus.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
eaolson
post Aug 3 2007, 02:59 PM
Post #11


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


QUOTE (crelf @ Aug 3 2007, 09:31 AM) *

Looks like I owe crelf and orko a doughnut.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Aug 3 2007, 03:14 PM
Post #12


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3740
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (eaolson @ Aug 4 2007, 12:59 AM) *
Looks like I owe crelf and orko a doughnut.

Sweet!


--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
eaolson
post Nov 3 2007, 07:27 PM
Post #13


Extremely Active
****

Member
Posts: 269
Joined: 15-September 05
Member No.: 3014
Using LabVIEW Since:1998
LV:7.1.1 ,8.0.1 ,8.20
United States us_texas us_illinois


I finally got around to updating this so you can load and save the state of the grid. It doesn't affect the cosmetic options (color, cell size, etc.), just which cells are alive and dead.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Aristos Queue