| ²é¿´: 1307 | »Ø¸´: 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 |
» ²ÂÄãϲ»¶
322Çóµ÷¼Á
ÒѾÓÐ12È˻ظ´
µç×ÓÐÅÏ¢270Çóµ÷¼Á
ÒѾÓÐ16È˻ظ´
272·Ö²ÄÁÏ×ÓÇóµ÷¼Á
ÒѾÓÐ50È˻ظ´
295·ÖÇóµ÷¼Á
ÒѾÓÐ13È˻ظ´
339Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
Ò»Ö¾Ô¸¹þ¹¤´ó 085600 277 12²Ä¿Æ»ùÇóµ÷¼Á
ÒѾÓÐ28È˻ظ´
µ÷¼ÁÇóÊÕÁô
ÒѾÓÐ28È˻ظ´
290µ÷¼ÁÉúÎï0860
ÒѾÓÐ26È˻ظ´
2±¾£¬³õÊÔ303£¬0860Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
²ÄÁϹ¤³Ì281»¹Óе÷¼Á»ú»áÂð
ÒѾÓÐ28È˻ظ´
» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:
ÐÞ¸ÄÒ»¸öCÓïÑÔÉúÃüÓÎÏ·³ÌÐò
ÒѾÓÐ3È˻ظ´
chrislan625
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 54.5
- Ìû×Ó: 73
- ÔÚÏß: 7.4Сʱ
- ³æºÅ: 2005447
- ×¢²á: 2012-09-16
- רҵ: ½ðÊô½á¹¹²ÄÁÏ
|
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
libralibra
ÖÁ×ðľ³æ (ÖøÃûдÊÖ)
æôÆï½«¾ü
- ³ÌÐòÇ¿Ìû: 40
- Ó¦Öú: 817 (²©ºó)
- ½ð±Ò: 12914.1
- ºì»¨: 64
- Ìû×Ó: 2238
- ÔÚÏß: 287.3Сʱ
- ³æºÅ: 696514
- ×¢²á: 2009-02-05
- רҵ: ¼ÆËã»úÈí¼þ

3Â¥2013-11-11 21:15:04
chrislan625
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 54.5
- Ìû×Ó: 73
- ÔÚÏß: 7.4Сʱ
- ³æºÅ: 2005447
- ×¢²á: 2012-09-16
- רҵ: ½ðÊô½á¹¹²ÄÁÏ
4Â¥2013-11-15 09:24:29













»Ø¸´´ËÂ¥