生活的游戏 - 输入蟾蜍图案 [英] Game of life - input for toad pattern

查看:184
本文介绍了生活的游戏 - 输入蟾蜍图案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人能请确认为游戏人生:

Can anyone please confirm for game of life:

如果输入

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

- x x x
x x x -

是相似的。如是。怎么样 ??请解释一下。

are similar . If yes. how ?? please explain.

有关背景的游戏人生的问题。请参阅在游戏中蟾蜍图案生活的它基本上是癞蛤蟆模式输入。

For background on "game of life" problem .. please refer Toad pattern in game of life it is basically toad pattern input.

推荐答案

从理论的角度来看,两者是相同的,因为细胞的电网是无限的,而不是表示假定所有的细胞是最初死了。

From a theoretical perspective, the two are identical, since the grid of cells is infinite, and all cells not denoted are assumed to be initially dead.

在实践中,然而,它取决于具体的实现寿命如何处理的细胞,对当前电网的边缘。根据该实现,有治疗边缘细胞的三种常用的方法:

In practice, however, it depends on how your implementation of Life handles cells that are on the "edge" of the current grid. Depending on the implementation, there are three common ways of treating "edge" cells:

  1. 网格被扩展以容纳新的细胞来生活当前电网外(到一定限度,因为只有有限的可用内存)。
  2. 细胞会来的生活网格的外部被忽略。
  3. 边缘上的细胞被认为是相邻的相反边缘上的细胞(即网格环绕)。

如果您的实施需要在第二或第三方法中,图案将产生不同的结果。

If your implementation takes the second or third approach, the patterns will produce different results.

要避免这种混淆,其保持包含一定的空间内的图案可表示包括任何必要的初始死空间,从而避免了边缘问题都在一起。这是已经采取了第一图案的方法

To avoid this confusion, patterns which stay contained within a certain space can be denoted including any necessary initially dead space, so as to avoid the edge problem all together. This is the approach that has been taken in the first pattern.

这篇关于生活的游戏 - 输入蟾蜍图案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆