LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Game of Life

Hello, i would like to see your game, but im on LV2011, any chance you could atach your program in that version, Thank you

 

0 Kudos
Message 11 of 19
(960 Views)

I have set up the program just as you adviced, but I have not come accross DigNum RefNum and I am unsure where to find them and what they are:/

0 Kudos
Message 12 of 19
(934 Views)

@yoko911 wrote:

Hello, i would like to see your game, but im on LV2011, any chance you could atach your program in that version, Thank you

 


This should work, let me know if it doesn't:)

0 Kudos
Message 13 of 19
(928 Views)

I examined your Life or Death.vi and it's not wired correctly.  The game works better after reconfiguring that block diagram.  Also, instead of using a new Index Array primitive for each element you should just expand the primitive so you only have one.


@MyronHuzan wrote:

I have set up the program just as you adviced, but I have not come across DigNum RefNum and I am unsure where to find them and what they are:/


I explained how to create the property nodes but maybe I wasn't clear.  Right-click on the control you want to create a property node for.  This brings up a menu.  Select Create|Property Node|Disabled.  Here's a picture:

Create Property Node.png

 

After that you can right-click on the property node and select Change All to Write.

 

Chage to Write.png

 

Then right-click on the property (Disabled) and select Create|Constant.

 

Create Constant.png

 

You can now left-click on the constant and change it to Enabled, Disabled, or Disabled and Grayed.

 

Property nodes are used to change the properties of controls, etc. during run-time.  You can change the label text, size, position visibility, etc. programatically.  Most things you can do to the control during editing you can change during run-time with a property node.

 

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 14 of 19
(902 Views)

Thanks for the screen shots, made more sense I think I just clicked on something wrong last time, I have made the controls vanish when the program is running and when the stop button is hit they re-appear, never knew you could do that, I think I will read more into property nodes. One question about property nodes, I found that when I aborted the program by not using the stop button Boolean they were blanked out, can this be resolved or is it just a downside of the program.

I will change the index array's to be all one, didn't realise you could just extend it, and also I am unsure how you mean to wire it better, this was the only was I thought to wire it, I can't see another way to compare the surrounding 26 blocks without doing it this way

Thanks again, 
Myron

0 Kudos
Message 15 of 19
(886 Views)

If you abort the program instead of ending it cleanly the controls will be in whatever state the property node left them.  Remember, the Abort button is only for debugging and should never be used to end a working program.  You can hide it in the VI Properties so it can't be used.

 

When I said the Life or Death VI is wired wrong I meant that you missed some of surrounding cells when wiring it.  Remember I told you I didn't think it was wired the way you thought it was because it was such a mess at first.  The three index inputs on the Index Array primitive correspond to the three axis and, top down, are page, row, column or Z Y X.  You need three values from each axis, current, current +1, and current -1.  Since you don't want to compare the current cell but only those around it you only need 26 unique indexes.  You have three loops corresponding to the three axis; the outer one is Z, middle is Y, and inner is X.  Wire all three iteration counters into the inner loop and drop +1 & -1 primitive for each one.  Now you have the index values you need, wire them to the expanded Index Array primitive so all 26 are unique an you have not wired one corresponding to the current cell.  I did this and it works better.  This is a good exercise in logic.

 

The other problem I see is there needs to be some logic for the cases of the cells on the edges.  Right now you end up checking some cells twice because Index Array will coerce the index value so it is never less than zero or greater than the array size.  At the edges there is no cell in those places so you need to force a dead cell for comparison.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 16 of 19
(879 Views)

I understand now about the abort, thanks. I will try and re-wire the Index Array better and see how I go from there when I get the time to wire that mess, hopefully I will get the same result as you:) 

I recognised the sides as being a problem, but I jsut wanted to set it asside before I got most of the program running as I would have liked, an option I thought of but need time to implament was to maybe wrap to sides around and see how that works, or just have altering rules for cells on the edges.

Thanks

0 Kudos
Message 17 of 19
(874 Views)

Wrapping the sides does some (mathematically) interesting things.  For example, if you consider a 2-D version and ask what happens when you join left and right edges, and top and bottom edges, you get a surface that is effectively the surface of a doughnut (a mathematician would say "topologically equivalent to a torus").  My head hurts when I think about doing this with a 3-D cube (visualizing 4-D space is a bit of a challenge) ...

0 Kudos
Message 18 of 19
(848 Views)

@Bob_Schor wrote:

Wrapping the sides does some (mathematically) interesting things.  For example, if you consider a 2-D version and ask what happens when you join left and right edges, and top and bottom edges, you get a surface that is effectively the surface of a doughnut (a mathematician would say "topologically equivalent to a torus").  My head hurts when I think about doing this with a 3-D cube (visualizing 4-D space is a bit of a challenge) ...


Yeah, I have tried not to think about it too much... But if I pull it off I could be in for a good grade I guess:)

0 Kudos
Message 19 of 19
(839 Views)