早教吧 育儿知识 作业答案 考试题库 百科 知识分享

关于C++的一个问题,懂英语的麻烦来帮下忙,很有趣的程序ThegameofLife,inventedbymathematicianJohnH.Conway,isintendedtomodellifeinasocietyoforganisms.Considerarectangulararrayofcells,eachofwhichmaycontainan

题目详情
关于C++ 的一个问题,懂英语的麻烦来帮下忙,很有趣的程序
The game of Life,invented by mathematician John H.Conway,is intended to model life in a
society of organisms.Consider a rectangular array of cells,each of which may contain an organism.
If the array is assumed to extend infinitely in both directions,each cell will have eight neighbors,the
eight cells surrounding it.Births and deaths occur according to the following rules:
a) An organism is born in an empty cell that has exactly three neighbors.
b) An organism will die from isolation if it has fewer than two neighbors.
c) An organism will die from overcrowding if it has more than three neighbors.
d) All other organisms survive to the next generation.
Write a program to play the game of Life and investigate the patterns produced by various initial
configurations.Some configurations die off rather quickly; others repeat a certain number of
generations; others change shape and size and may move across the array; and still others may
produce 'gliders' that detach themselves from the society and sail off into space.












▼优质解答
答案和解析
先定义一个3维的数组.为数组作初始化(各种不同初始状态下模型的运行情况),
a,用for循环判断,如果相邻的3个元素都为1就把这元素设为1更新数组,下面这情况是类式的,如果数组都为0那就说明灭绝了
看了 关于C++的一个问题,懂英语...的网友还看了以下:

我要写英语作文各位大师帮帮我题目:请您写一写你的父母是干什么的,他做什我要写英语作文各位大师帮帮我  2020-05-13 …

we的e在英音里发/i/还是/:e/的音?me的e在英音里发/i/还是/:e/的音?he的e在英音  2020-05-13 …

帮我回答英语问题,英语好的进我英语不好,帮我看看下面几题怎么填,一定要对!1.Whereareth  2020-05-15 …

求个高手帮写篇英语作文假如你叫王涛给你的邓老师写一封E-mail交流以便得到他的帮助并得到一些建议  2020-07-02 …

英语英标ə发什么音啊是不是类似汉语饿呀我怎么听起来像饿儿呢那位英语高手帮我解释一下好吗是单词E在英  2020-07-04 …

英语排序题和填空题,各位能帮我一个忙吗,能帮我从你们的英语练习的书里,出10题英语填空题目,和一题  2020-08-01 …

英语音标问题英式英标中的[e]和倒写的[e]在美式音标中怎么写爱词霸上用的是老式的我看不懂字典在学校  2020-11-07 …

请英语高手快来帮帮忙,做做这几道英语作业选择题31-40题英语高手快来帮帮忙,做做这几道英语作业选择  2021-01-01 …

问一下关于英语很低级的问题英语中单词的复数形式怎么改比如:以e结尾的加s还有以h或者r结尾的加什么还  2021-01-04 …

关于英语的问题.英语最后的一些尾词通常都有变化;例如e会变i也有加ing我想找的是这些尾加词;帮个忙  2021-01-25 …