Life Counter

Life Counter

Moderate
EN 日本語 RU

ライフゲーム(The Game of Life) , または単に "ライフ(Life)" として知られているそれは1970年にジョン・ホートン・コンウェイ (John Horton Conway) によって考案されたゲームであり、またセル・オートマトンである。 これは無人のゲームである。このことは初期状態によって展開が決定されることを意味しており、それ以上の入力は必要としない。 このゲームは初期設定だけが変更可能な要素であり後はどの様に展開するかを観察するだけであるが上級者は特定の設定からパターンを作り出す。

ライフゲームの世界は直交する正方形のセルによって構成される無限の2次元であり、各々のセルは生か死かの二つの状態を持つ。 各セルは横、縦、斜めの8つの隣接セルの影響を受け各ステップにて以下の変化が生じる:
- 隣接セルに生存セルが2より少ない生存セルは過疎により死ぬ。
- 隣接セルに生存セルが2か3の生存セルは生き残る。
- 隣接セルに生存セルが3より多い生存セルは過密により死ぬ。
- 隣接セルに生存セルがちょうど3の死亡セルは誕生により生存セルとなる。

最初のパターン(または0ステップ)は本システムの種となる。 全ての最初の世代は上記のルールが同時に適用され生と死が同時に発生する。 この各瞬間の出来事を時々 tick (※時の一刻み) と呼ぶ。 (言い換えれば各世代は単純に前世代により決定されることになる) このルールは先の世代を生成するために繰り返し適用される。

あなたはこのミッションでN回目の tick における生存セルを数えることになる。 あなたには初期配置(生存セルが存在する格子の断片)の行列と N 回目の tick を数値として与えられる。 行列はタプルのタプルとして表現され、1は生存セル、0は死亡セルである。 格子は各方向に無限に広がるのを忘れないように。

life

上記の例の初期配置は以下のように表現される:

((0, 1, 0, 0, 0, 0, 0),
 (0, 0, 1, 0, 0, 0, 0),
 (1, 1, 1, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 1, 1),
 (0, 0, 0, 0, 0, 1, 1),
 (0, 0, 0, 0, 0, 0, 0),
 (1, 1, 1, 0, 0, 0, 0),)

もし 4tick目の生存セルを数える場合、上図より15が答えとなる。 ...

You should be an authorized user in order to see the full description and start solving this mission.
45
Settings
Code:
Other:
Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

×
 
 
<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission