Error in Life is Simple solutions?

Back to General discussions forum

Frost on ice     2017-11-14 21:46:20

Hi all,

I've tried to compute a number of times this problem and I think there is an error. If you have a grid:

----XXX -XXXX-- -XX-XX- ------X ---X-X-

The solution the problem shows is 12 18 12 16 15, however this is wrong (it should return 11 14 10 9 13). Does anybody know how this is possible?

Quandray     2017-11-15 07:35:45
User avatar

Does your code give the correct answer for the example input?
12 18 12 16 15 is the correct answer. If you can't find your error, please show us what you think the grid is after 1 turn.

Frost on ice     2017-11-15 17:00:21

Hi,

My code does output the correct answer for the example.

for this grid:

[- - - - X X X] [- X X X X - -] [- X X - X X -] [- - - - - - X] [- - - X - X -]

The first iteration would be: [- - X - X X -] [- X - - - - X] [- X - - X X -] [- - X X - - X] [- - - - - - -]

I've tried doing it by hand, and unless I made a mistake, there should be 11 life forms.

Quandray     2017-11-15 17:51:37
User avatar

The initial configuration is a 5 by 7 fragment of the game field.
For the first move, if you put the initial configuration in the middle of a 7 by 9 grid, you'll get 12 life forms.

Frost on ice     2017-11-15 21:36:08

So do I need to use a 7 by 9 grid instead of the 5 by 7?

Quandray     2017-11-16 07:18:26
User avatar

Note: if you will implement the game using a kind of 2D array, make sure it is large enough and the initial configuration is placed far from edges, so that it will not reach them in 5 moves - otherwise your results could be spoiled.

Please login and solve 5 problems to be able to post at forum