LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stuck in Game of Life

Hi i am trying to design the game of life for several days and i am stuck in it badly. Anybody who has solved this core 1 exercise, i could really use your help. I designed the VI but i couldn't get past through the surrounded regions i mean the Os at the borders are successfully converted to Xs but i can't figure out the logic of not making Os into Xs where the region joins the Os in the border.

0 Kudos
Message 1 of 17
(264 Views)

Post your actual VI, instead of screenshots of the problem.  We can't see where you've gone wrong otherwise.

 

And by "actual VI" I mean the VI file itself, not screenshots of it.

 

If you back-save it to earlier versions (I recommend 2019) then more people can look at it, a lot of us don't update to the most recent version for quite a while.

0 Kudos
Message 2 of 17
(249 Views)

For all squares, check the 8 surrounding ones and calculate the amount of live ones to determine the next State.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 17
(197 Views)

One small hint:  a common way to go astray is to incrementally apply updates into the same 2D dataspace that you're evaluating.  This ends up violating the rule that says changes should be applied "simultaenously".

One way to avoid this is at the beginning of each new round, "freeze" the existing state by making a copy.  Do all your evaluations on the copy, and all your updates in the primary 2D dataspace.

Have fun!

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 17
(148 Views)

Hi there LabView community, I have done almost every possible try to resolve the issue where the regions surrounded by Xs are to be converted into Os but I'm stuck in figuring out the logic where the regions that touch the boundary of the matrix are not to be converted into Xs. I have designed the VI where it converts everything except the Os on the border of the matrix but the problem is it is converting even the Os that are linked to the region having Os connected to the borders. 
I Thank LabView community in advance for being so quick in response! 

0 Kudos
Message 5 of 17
(226 Views)

You'll get better responses if you do a "save fore previous" ((e.g. LabVIEW 2019) before attaching. I cannot open your VI.

0 Kudos
Message 6 of 17
(167 Views)

'Surrounded' as in ortogonally or all 8 surrounding blocks? How are edges considered?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 17
(145 Views)

With your input, no O is surrounded, so the output would be the same? 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 17
(139 Views)

Something like this maybe?

Yamaeda_0-1745331387853.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 9 of 17
(135 Views)

Ok I see that u are trying to traverse in all the 4 directions when ever the loop finds any Os and then if the region is completely consisting of Os alongwith the borders you are not going to change it to Xs and vice versa. Well that's sounds like a fair approach I'll try this one out and let you know! Thanks 

0 Kudos
Message 10 of 17
(98 Views)