LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Game of life

Solved!
Go to solution

Hello,

 

I am a student and I have been given a task and wanted to ask for some help. I was asked to create a VI that implements the Game of Life. These were the instructions that were given to me:

 

Create a VI that implements The Game of Life, i.e., a cellular automaton devised by the British mathematician John H. Conway.

The Game of Life world is an infinite, two-dimensional array of cells, each in one of two states: alive or dead. Each cell interacts with its eight neighbors, i.e., cells with which it shares its edges or corners. At each time step, the following changes occur:

a cell with fewer than two living neighbors dies of underpopulation

a cell with two or three living neighbors survives until the next iteration

a cell with more than three living neighbors dies from overpopulation

in place of a dead cell with exactly three living neighbors, a living cell is born.

All these changes occur simultaneously, i.e., the next generation of cells is determined uniquely by the preceding generation.

Represent the game world with an LED array control, where the user can add cells by clicking on individual LEDs -both while the VI is running and before it runs.

Additional requirements:

the game world presented in the array should have the same number of rows and columns;

the user should be able to choose the size of the presented area of the game world before starting the VI however, changing the height and width of the control does not have to occur automatically;

since the game environment should be an infinite two-dimensional array of cells, treat the presented area as infinitely repeating, i.e., touching edges with identical, shifted areas;

during the VI operation, the user should be able to clear the game world of living cells;

the game time step should be adjustable from 50 ms to 2 secs in 50 ms increments.

The user should be able to place a sample built-in cell pattern in the game world (include at least three patterns to choose from). Search the Internet for patterns whose evolution is known: e.g., Glider will travel diagonally across the matrix, Boat will remain still, Blinker will oscillate, and Glider gun will fire Gliders.

 

I attached my VI and if anyone could tell me how to proceed it will be great

Message 1 of 7
(1,006 Views)

what is your question about your problem ? 

I will assume you don't want us to do the project for you. 

 

0 Kudos
Message 2 of 7
(1,003 Views)

No, I don't want you to do the project for me. It is just that I'm having trouble in running it, I'm having an error in case structure that I have a wrong type of selector and that for some selector values have no case. I am not that experienced in Labview and I'm having trouble understanding what this means

0 Kudos
Message 3 of 7
(997 Views)

Sounds good, Can you provide the file for version2020 ? 

0 Kudos
Message 4 of 7
(981 Views)

Here it is and sorry for the previous confusion I didn't word very well my problem

0 Kudos
Message 5 of 7
(972 Views)
Solution
Accepted by topic author E_ll_e

Thank you !

The case structure in your code is wired to an integer number. But the case is using String text  : Alive / Dead. 

Use the numeric values instead of the text. 

 

It also accepts intervals for example, let's stay that Alive is any number bigger than 10, you would type Case 10..

 

LVNinja_0-1686081044727.png

 

and Dead is any number bellow 9, use ..9

LVNinja_1-1686081060464.png

 

0 Kudos
Message 6 of 7
(964 Views)

Thank you it is now working

Message 7 of 7
(955 Views)