Toad pattern in game of life

情到浓时终转凉″ 提交于 2019-12-06 08:37:48

Your output from your described input for TOAD matches the rules you've stated. The stated expected output doesn't match the rules.

It's not clear you have a problem in your program, but in your interpretation of TOAD, as noted by veredesmarald.

I'll also note that you defined input/expected-output for TOAD as follows:

Input
- X X X
X X X -
- - X -
Output
X - - X
X - - X
- X - -

And that if I move the line "Output" up one line the result matches the standard/expected definition of TOAD input/output:

Input
- X X X
X X X -
Output  // swapped with line below
- - X -
X - - X
X - - X
- X - -

It appears something simply got lost in translation, and your program may be fine.

verdesmarald

All the examples of the toad pattern I found via google look like this:

State 1:

- - - -
- x x x
x x x -
- - - -

State 2:

- - x -
x - - x
x - - x
- x - -

These two states oscillate like so:

Your input appears to be missing the top row and also has an extra live cell in the bottom row. As a side note, the "bloat" pattern you mentioned is actually called "boat", because it looks like an overhead view of a small boat.

See:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!