这道题怎么做?过程详细点,刚学会走路的小孩没学会。

这是个机器人猖狂的时代,请输一下验证码,证明咱是正常人~php我刚学这个没有多久,老师给了我一道题目,我不知道要怎么做,请大家帮帮我吧!谢了 题目是英文的。谢_百度知道
php我刚学这个没有多久,老师给了我一道题目,我不知道要怎么做,请大家帮帮我吧!谢了 题目是英文的。谢
Write a program to simulate a simplified version of Conway’s Game of Life. The Game Of Life is a zero player game which starts from an initial (randomly generated) 2D array configuration and then evolves without any user input.The simulation begins with a 16 x 16 2D array, which represents life. Each cell in the 2D array can be in one of two states: live or dead. Every cell in the 2D array can only interact with its surrounding 8 neighbours.the program should randomly generate “dead” or “live” values for the initial configuration of the 2D array. Next, the program should generate a random number between 5 and 20, inclusive, which will be the number of times the simulation should run. For example, when 5 is randomly generated, the program should compute and display the next 5 steps of the 2D array configuration. For each step of the simulation, the following rules must be applied to each cell:Any “live” cell that has less than 2 “live” neighbour cells becomes “dead” due to under-population.Any “live” cell that has 2 or 3 “live” neighbour cells remains “live”.Any “live” cell that has more than 3 “live” neighbour cells becomes “dead” due to over-crowding.Any “dead” cell that has exactly 3 “live” neighbour cells becomes “live” again due to reproduction.Thus the simulation will run as follows:• Show the initial configuration of the 2D array with the cells either “live” or “dead”• Show the random number generated indicating the number of steps it will run• For each step:o Show the next configuration of the 2D array with the cells either “live” or “dead” based on the rules above. the program should print the following statistics:• Total number of initial “live” cells.• Total number of initial “dead” cells.• Total number of cells that went from “live” to “dead” after all the steps.• Total number of cells that went from “dead” to “live” after all the steps.
我有更好的答案
写一个程序来模拟一个简化版本康威的生命游戏。生活的游戏是一零个玩家游戏,开始从最初的(随机)的二维数组配置和随后的发展没有任何用户输入。
仿真始于一个16×16的二维数组,它代表生命。每个细胞中的二维数组可以在一两个国家:活的或死的。每一个细胞在二维数组可以互动与周围的8个邻居。
程序随机生成的“死”或“活”的值的二维数组的初始配置。下一步,该程序应产生一个随机数之间的5和20,包容性,它会有多少次仿真运行。例如,当5个是随机产生的,该程序应计算和显示5个步骤的二维阵列配置。
每一步的仿真,以下规则必须应用到每个细胞:
任何“活”的细胞,有不少于2的“活”的邻居细胞变成“死”,由于under-population。
任何“活”的细胞有2个或3个“活”的邻居细胞仍然是“活...
其他类似问题
为您推荐:
php的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁这是个机器人猖狂的时代,请输一下验证码,证明咱是正常人~圆锥体绕轴运动 (刚体力学)左侧没照到的字从上到下依次是:的,如,小,始.(应该不会影响到题目的理解.)我刚体力学这刚学了几天,不熟练.求问这道题怎样做?怎样分析的?_百度作业帮
圆锥体绕轴运动 (刚体力学)左侧没照到的字从上到下依次是:的,如,小,始.(应该不会影响到题目的理解.)我刚体力学这刚学了几天,不熟练.求问这道题怎样做?怎样分析的?
圆锥体绕轴运动 (刚体力学)左侧没照到的字从上到下依次是:的,如,小,始.(应该不会影响到题目的理解.)我刚体力学这刚学了几天,不熟练.求问这道题怎样做?怎样分析的?
能量E=(1/2)Jw²& & & & & & & & &J&转动惯量能量守恒(1/2)Jw0²=(1/2)Jw²+(1/2)mv²v=wRw=.&&&&v'=v+v''&(矢量相加)|v'|=√(v²+v''²)&v=wR&(1/2)mv''²=mghv'=.
要好好学习哦这道题怎么做:自立作为成长的过程,
自立作为成长的过程,是我们生活能力的锻炼过程,也是我们心理和道德品质的锻炼过程.在这个过程中:
A、不断完善自己,学会自尊,提高法_百度作业帮
这道题怎么做:自立作为成长的过程,
自立作为成长的过程,是我们生活能力的锻炼过程,也是我们心理和道德品质的锻炼过程.在这个过程中:
A、不断完善自己,学会自尊,提高法
这道题怎么做:自立作为成长的过程,
自立作为成长的过程,是我们生活能力的锻炼过程,也是我们心理和道德品质的锻炼过程.在这个过程中:
A、不断完善自己,学会自尊,提高法律意识
B、逐步学会尊重他人,善于与他人沟通和交往,和谐相处
C、积极地融入社会,关爱社会,奉献社会
D、成为一个对自己负责,对他人负责,对社会负责的能够自立自强的人}

我要回帖

更多关于 学会感恩主题班会教案 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信