Найти - Пользователи
Полная версия: Вопрос по задаче
Начало » Python для новичков » Вопрос по задаче
1
gelo
Доброго дня всем,

хотел бы узнать, есть задача, подчеркну только то что меня ввело в заблуждение


===>
Consider a representation of a “world” as an n by n matrix. Each element in the matrix may contain 1 organism. Each organism lives, dies and reproduces according to the following set of rules:

- If there are two or three organisms of the same type living in the elements surrounding an organism of the same, type then it may survive.

- If there are less than two organisms of one type surrounding one of the same type then it will die due to isolation.

- If there are four or more organisms of one type surrounding one of the same type then it will die due to overcrowding.

- If there are exactly three organisms of one type surrounding one element, they may give birth into that cell. The new organism is the

same type as its parents. If this condition is true for more then one

species on the same element then species type for the new element is chosen randomly.

- If two organisms occupy one element, one of them must die (chosen

randomly) (only to resolve initial conflicts).
<===


Вроде как 1 элемент содержит 1 организм, т.е 1 элемент это, типа, 1 организм

Как тогда может быть, что два или три организма располагаются в элементе, окружающем некий организм одинакового типа. (это я про первое тире)

Предполагаю, что ошибка либо м задаче а либо в моем знании английского языка.

Объясните пожалуста, кто может

Спасибо
gelo
я это понял следующим образом, есть некая планетка, где живут всякие существа - организмы.

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20

т.е. если 2 и 6 (одинакового типа) окружают 1 (такого же типа как и эти два), значит 1 выживает. Правильно?
Вообщем определение понятий мне тут не совсем хорошо ясно, что есть элемент а что за организм. И вообще, часть предложения (первого пункта, например) then it may survive означает что выживает элемент 1 или два элемента, окружающие элемент 1?

Мде ..
Ferroman
  12345678
1 **00****
2 **0*****
3 ********
4 ********
Организм 1,3 выживает, из-за присутствия 1,4 и 2,3
gelo
спасибо, а вот вторая часть
If there are less than two organisms of one type surrounding one of the same type then it will die due to isolation
получается так?:

12345678
1 **0*****
2 **0*****
3 ********
4 ********

и умирает 1,3?
Ferroman
Оба умирают.
igor.kaist
Это не игра ли “жизнь” случайно?
http://ru.wikipedia.org/wiki/Жизнь_(игра)
Ferroman
Да она самая.
igor.kaist
так на русском полно статей по ней…. Одной страницы в вики хватит для её реализации.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB