²é¿´: 1276  |  »Ø¸´: 3
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

chrislan625

гæ (СÓÐÃûÆø)

[ÇóÖú] Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд

ÀÏʦ½ÐÎÒÃÇ×Ôѧ ÉϿξÍҪд³öÒ»¸öÉúÃüÓÎÏ·µÄ´úÂë ¿´²»Ì«¶® ÒÔÏÂÊÇÀÏʦ¸øµÄÌáʾ

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
%
%   Output parameters
%   None
%
%
%   Define some constants
delay = 0.1; % The time between images in seconds
dx = [-1,  0,  1, -1,  1, -1,  0,  1];
dy = [ 1,  1,  1,  0,  0, -1, -1, -1];
%
%   Initialise the grid
world = zeros(nx+2, ny+2); % Extra sites around the edge fixed to zero

[Add code here]

%
%   Display the world
imagesc(world);
pause(delay);
%
%   Step through all the moves
for i = 1:nstep
    %
    %   Count the number of neighbours for each site

[Add code here]

    %
    %   Update the world

[Add code here]

    %
    %   Display the world
    imagesc(world);
    pause(delay);
end

end
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

chrislan625

гæ (СÓÐÃûÆø)

ÒýÓûØÌû:
3Â¥: Originally posted by libralibra at 2013-11-11 21:15:04
²»Í¬ÉúÃüÓÎÏ·µÄ¹æÔò¿ÉÒÔ²»Í¬,Ò»°ã¶¼ÊÇÁÚÓòСÓÚ2»òÕß´óÓÚ3,»îcell»áËÀµô.ÁÚÓòµÈÓÚ3,ËÀcell¿ÉÒԳɻî.Èç¹ûÊÇÕâ¸ö¹æÔò,5*5run5´ÎºÍ7*7run5´ÎµÄ½á¹ûÈçÏÂͼ.×Ô¼ºÊýһϾÍÐÐ.

5*5run5´Î


7*7run5´Î
...

´óÉñÇó½Ì~ ÎÒÃÇÒ»µã»ù´¡ÖªÊ¶¶¼Ã»½Ì¹ý°¡
4Â¥2013-11-15 09:24:29
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 4 ¸ö»Ø´ð

chrislan625

гæ (СÓÐÃûÆø)

1.        Consider the following starting configuration: a world made of 5x5 squares, with 3 creatures in a horizontal line (XXX) at the centre. How many creatures are alive after 5 steps?
2.        Consider the following starting configuration: a world made of 7x7 squares, with 5 creatures in a horizontal line (XXXXX) at the centre. How many creatures are alive after 5 steps?

ÕâÊÇÕâ¸ö³ÌÐòÒª½â¾öµÄÎÊÌâ
2Â¥2013-11-11 05:42:48
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

libralibra

ÖÁ×ðľ³æ (ÖøÃûдÊÖ)

æôÆï½«¾ü

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
xzhdty: лл²ÎÓë 2013-11-12 10:27:22
²»Í¬ÉúÃüÓÎÏ·µÄ¹æÔò¿ÉÒÔ²»Í¬,Ò»°ã¶¼ÊÇÁÚÓòСÓÚ2»òÕß´óÓÚ3,»îcell»áËÀµô.ÁÚÓòµÈÓÚ3,ËÀcell¿ÉÒԳɻî.Èç¹ûÊÇÕâ¸ö¹æÔò,5*5run5´ÎºÍ7*7run5´ÎµÄ½á¹ûÈçÏÂͼ.×Ô¼ºÊýһϾÍÐÐ.

5*5run5´Î
Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд

7*7run5´Î
Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд-1
matlab/VB/python/c++/Javaд³ÌÐòÇë·¢QQÓʼþ:790404545@qq.com
3Â¥2013-11-11 21:15:04
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ½ÓÊÕµ÷¼Á +4 ½òÃȽòÃÈ 2026-03-02 7/350 2026-03-02 16:37 by ½òÃȽòÃÈ
[¿¼ÑÐ] 290Çóµ÷¼Á +5 ErMiao1020 2026-03-02 5/250 2026-03-02 16:36 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] »¯Ñ§£¬²ÄÁÏ£¬»·¾³ÀàÇóµ÷¼Á +3 ¿¼Ñаæ°ô°ô 2026-03-02 3/150 2026-03-02 16:10 by @ìªìªìªìª
[¿¼ÑÐ] »¯¹¤×¨Ë¶348£¬Ò»Ö¾Ô¸985Çóµ÷¼Á +6 ¸¥¸ñ¸ö 2026-02-28 9/450 2026-03-02 14:09 by liyongv
[¿¼ÑÐ] »¯¹¤270Çóµ÷¼Á +8 ʲôÃû×Öqwq 2026-03-02 8/400 2026-03-02 13:03 by houyaoxu
[¿¼ÑÐ] һ־Ըɽ¶«´óѧ²ÄÁÏÓ뻯¹¤325Çóµ÷¼Á +3 °ë½ØµÄÊ«0927 2026-03-02 3/150 2026-03-02 12:58 by houyaoxu
[¿¼ÑÐ] 291 Çóµ÷¼Á +3 »¯¹¤2026½ì±ÏÒµÉ 2026-03-02 3/150 2026-03-02 12:55 by houyaoxu
[¿¼ÑÐ] 268Çóµ÷¼Á +4 ¼òµ¥µã0 2026-03-02 5/250 2026-03-02 11:54 by ms629
[¿¼ÑÐ] ²ÄÁÏѧ˶318Çóµ÷¼Á +14 February_Feb 2026-03-01 16/800 2026-03-02 11:17 by yuchj
[¿¼ÑÐ] Ò»Ö¾Ô¸Ö£´ó²ÄÁÏѧ˶298·Ö£¬Çóµ÷¼Á +6 wsl111 2026-03-01 6/300 2026-03-02 11:00 by ydudjddnd
[¿¼ÑÐ] 0854¸´ÊÔµ÷¼Á 276 +4 wmm9 2026-03-01 6/300 2026-03-02 09:28 by ÈÈÇéɳĮ
[¿¼ÑÐ] ¸ß·Ö×Ó»¯Ñ§ÓëÎïÀíµ÷¼Á +6 ºÃºÃºÃ1233 2026-02-28 13/650 2026-03-02 07:27 by ºÃºÃºÃ1233
[¿¼ÑÐ] 0856Çóµ÷¼Á285 +10 ÂÀ×ÐÁú 2026-02-28 10/500 2026-03-01 21:37 by ¹«èªåÐÒ£
[¿¼ÑÐ] 290Çóµ÷¼Á +9 ²ÄÁÏר˶µ÷¼Á£» 2026-02-28 11/550 2026-03-01 17:21 by sunny81
[¿¼ÑÐ] 313Çóµ÷¼Á +3 Ë®Á÷Äêlc 2026-02-28 3/150 2026-03-01 16:01 by ÐÂÄÜÔ´´ïÈË
[¿¼ÑÐ] 307Çóµ÷¼Á +5 wyyyqx 2026-03-01 5/250 2026-03-01 15:21 by Fff-1
[¿¼ÑÐ] 302²ÄÁϹ¤³ÌÇóµ÷¼Á +4 Doleres 2026-03-01 5/250 2026-03-01 11:52 by liqiongjy
[¿¼ÑÐ] 317Ò»Ö¾Ô¸»ªÄÏÀí¹¤µçÆø¹¤³ÌÇóµ÷¼Á +6 Soliloquy_Q 2026-02-28 11/550 2026-03-01 11:14 by ¸èliekkas
[ÂÛÎÄͶ¸å] ÇóÖúcoordination chemistry reviews µÄд×÷Ä£°å 10+3 ljplijiapeng 2026-02-27 4/200 2026-03-01 09:07 by babero
[˶²©¼ÒÔ°] ¡¾²©Ê¿ÕÐÉú¡¿Ì«Ô­Àí¹¤´óѧ2026»¯¹¤²©Ê¿ +4 N1ce_try 2026-02-24 8/400 2026-02-26 08:40 by N1ce_try
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û