求大神教MATLAB 生命游戏代码怎么写
1个回答
展开全部
老师叫我们自学 上课就要写出一个生命游戏的代码 看不太懂 以下是老师给的提示
Skeleton program
function game_of_life( nx, ny, nstep )
%GAME_OF_LIFE Implements the Conway game of life
% This function implements the Conway game of life in which beings are
% generated and destroyed in a manner meant to represent evolution. They
% are destroyed when they have too few or two many neighbours, and are
% generated at a location with the right number of neighbours.
%
% Input parameters
% nx The number of squares along the x-direction
% ny The number of squares along the y-direction
% nstep The number of iterations in the game
Skeleton program
function game_of_life( nx, ny, nstep )
%GAME_OF_LIFE Implements the Conway game of life
% This function implements the Conway game of life in which beings are
% generated and destroyed in a manner meant to represent evolution. They
% are destroyed when they have too few or two many neighbours, and are
% generated at a location with the right number of neighbours.
%
% Input parameters
% nx The number of squares along the x-direction
% ny The number of squares along the y-direction
% nstep The number of iterations in the game
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询