亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? notes.html

?? 一個(gè)用VB開發(fā)的細(xì)胞元?jiǎng)訖C(jī)
?? HTML
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Programming Info</title>
</head>

<body BGCOLOR="#FFFFE0" TEXT="#000000">
<DIV ALIGN="center"><H2>Notes for Programmers</H2></DIV>

<P>If you are a programmer and are interested in the underlying processing algorithm used in this application, here are few insights. No doubt it could be improved upon and I would be grateful for any related feedback.</P> 

<P>As you may imagine, a large grid could contain hundreds, if not thousands, of cells living and dying every generation. The computer must work furiously, calculating the number of neighbors for each cell in the grid, then creating cells, killing them, or allowing them to survive based on these counts. Keep in mind that counting the neighbors for a single cell requires checking each adjacent cell - as many as eight.</P>

The first approach that comes to most people's mind is to simulate the world grid with a 2D array representing each cell's col, row coordinates - with each array element containing either a 0 (dead) or 1 (alive). We should call this the "world" array. They would then iterate the array, applying Conway's rules for each element, updating that element for the next generation. This is wrong for two reasons. Look at a very simple example:<BR>

<IMG SRC="cells1.gif" WIDTH="250" HEIGHT="150" BORDER="0" ALT="">

<P>First, if you start at the top and process the grid by creating and killing cells as you go, you get incorrect results. Notice, when you get to cell (1,1) you'll kill it because it has only one neighbor. Then, when you get to empty cell (1,2), even though it should have come to life, having three neighbors originally, you determine that it has only two neighbors and leave it alone. When you get to cell (2,2), you think it has only one neighbor and kill it, even though this cell should have survived to the next generation. After processing the entire grid, you don't have the correct second-generation result. Instead, you have an empty grid!</P> 

<P>In short, in each generation, you must determine which cells COULD live or die, without changing the grid. Then when you finish, you must simultaneously create and kill the appropriate cells based on Conway's rules. This requires tricky algorithms, especially when you consider that all these calculations must be performed at a speed that allows fast screen updates. Sound like fun? </P>

<P>To help matters out let's add a second 2D array - the neighbor(col, row) array. Every cell on the grid is a potential neighbor so the array is is sized according to how many cols and rows are actually in the world grid. Every alive cell has up to 8 neighbor cells (cells on on the grid's borders have less). The neighbor array contains the running count of adjacent alive cells for each of those neighbors. In the illustration above, cell 1,1 is a neighbor of alive cell 2,1 so it's coordinates would define an element in the neighbor array neighbor(1,1). Neighbor(0,0) would equal zero, neighbor(1,1) would = 1 (cell 2,1 is it's only alive adjacent cell). Similarly, neighbor(1,2) would contain the number 3, etc. From then on, instead of re-calculating the entire grid in each generation, the program changes neighbor counts for only those cells adjacent to cells that have just been created or killed. This method cuts processing time significantly: In a given generation, the program must change the neighbor counts of only a small number of cells rather than the entire grid. </P>

<P>Even though the original world array records the status of each and every cell, you add two lists of cells: one for cells about to be created, and another for cells about to die. These are the only cells that affect the map; so why check the entire grid every generation?</P>

Let's see how to put all this together:<BR>
First we define the objects which we need to simulate Life.<BR>
We define a Cell object as nothing more than  two numbers - a col coordinate and a row coordinate. 
We define two 2D arrays:<BR>
<OL>
	<LI>The world(col,row) array - this maps all the cells to either being alive (1) or dead (0).</LI>
	<LI>The neighbor(col,row) array - described above.</LI>
</OL>
 

<P>We also define four Collections (or lists) of Cell objects (remember - a Cell object is nothing more than an row and col coordinate).<BR>
<OL>
	<LI>The CouldLive list - the "maybe" list of Cell objects that could possibly live the next generation. </LI>
	<LI>The CouldDie list - the "maybe" list of Cell objects that could possibly die the next generation. </LI>
	<LI>The Live list - a list of Cell objects that will be made alive. This list is actually the the end result of the CouldLive list.</LI>
	<LI>The Die list - a list of Cell objects that will be killed (made a 0 in the world array). This list is actually the the end result of the CouldDie list.</LI>
</OL>
</P>

Here's the flow of processing:<BR>
<OL>
	<LI>When the program begins, all arrays are zeroed and all lists are empty.</LI>
	<LI>The user sets the initial pattern. If she left clicks a cell to life a one is added to the appropriate world array element and a Cell object having the associated col, row coordinates is added to the Live list.. Right clicking an alive cell replaces the one with a zero in that world array element and the associated object is removed from the Live list. This defines the first (or initially placed) generation.</LI>
	<LI>When the user Starts the simulation for the first time (or initially clicks the Step button), we scan the Live list and increment the neighbor count of every cell adjacent to a cell in the list. Cells that might come to life in the next generation are added to the CouldLive list, and cells that might die in the next generation are added to the CouldDie list.</LI>
	<LI>Empty the Live list.</LI>
	<LI>Process the resulting neighbor array. For every element in the array, if the associated cell is alive and the count is less than 2 or more than 3 we add the Cell object to the CouldDie list.</LI>
	<LI>Transfer the CouldLive list to the Live list and the CouldDie list to the Die list.</LI>
	<LI>Scan the Live list and if the cell was dead and it has exactly 3 neighbors, bring it to life (update it's world array element with a 1 and paint it as alive on the screen). Otherwise remove it from the Live list.</LI>
	<LI>Scan the Die list and if the cell was alive and it doesn't have 2 or 3 neighbors, kill it (update it's world array element with a 0 and erase it from the screen). Otherwise remove it from the Die list.</LI>
	<LI>Scan the Live list and increment the neighbor count of every cell adjacent to a cell in the list. Cells that might come to life in the next generation are added to the CouldLive list, and cells that might die in the next generation are added to the CouldDie list. </LI>
	<LI>Scan the Die list and decrement the neighbor count of every cell adjacent to a cell in the list. Cells that might come to die in the next generation are added to the CouldDie list, and cells that might live in the next generation are added to the CouldLive list.</LI>
	<LI>Transfer the CouldLive list to the Live list and the CouldDie list to the Die list.</LI>
	<LI>This ends the processing for the second generation. For each subsequent generation we just repeat steps 7 - 11.</LI>
</OL>

<P>Pretty simple, huh?<BR>
If you have the VB6 source code it becomes much easier to get a feel for the algorithm by using the debugger to set breakpoints and single step the following procedures that do most of the work:</P>


<P><STRONG>UpdateDisplay()</STRONG> - Called to start a new generation - this procedure calls each of the following which actually do all the processing:<BR></P>

<P><STRONG>CreateLists()</STRONG> - Steps 3-6 - Only used on the first pass to set up the lists.<BR>	
<PRE>  
   --------> <STRONG>Live()</STRONG>     Step 7
  |          <STRONG>Die()</STRONG>      Step 8
  |          <STRONG>AddNbrs()</STRONG>  Step 9
  <--------  <STRONG>SubNbrs()</STRONG>  Step 10
</PRE></P>


</body>
</html>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成年人网站在线观看| 亚洲国产精品二十页| 国产精品一区二区三区乱码| 亚洲男人电影天堂| 久久久久久麻豆| 91精品国产福利| 97久久超碰国产精品| 老色鬼精品视频在线观看播放| 一区二区欧美国产| 国产女主播在线一区二区| 日韩一区二区三区电影 | 99re成人精品视频| 蜜臀av性久久久久蜜臀av麻豆| 亚洲精品中文在线影院| 久久久久久电影| 91精品国产免费| 欧美视频一区二区三区在线观看| 成人免费福利片| 国产激情91久久精品导航 | 成人av免费网站| 国产原创一区二区| 免费观看91视频大全| 亚洲成人av一区| 一区二区三区成人| 国产精品久久久久久久久免费丝袜| 精品国产在天天线2019| 日韩欧美一级精品久久| 69久久99精品久久久久婷婷 | 国产精品免费av| 国产亚洲成年网址在线观看| 欧美一区二区三区日韩| 欧美乱妇15p| 欧美日韩国产一区| 欧美美女一区二区| 欧美久久久久久久久中文字幕| 欧美日韩亚洲综合一区| 欧美午夜理伦三级在线观看| 91福利在线播放| 欧美中文字幕一二三区视频| 91国偷自产一区二区三区观看| 色哟哟一区二区三区| 91日韩在线专区| 91成人网在线| 欧美日韩激情在线| 日韩一区二区中文字幕| 日韩你懂的在线播放| 精品裸体舞一区二区三区| 日韩午夜在线观看| 欧美精品一区二| 国产蜜臀av在线一区二区三区| 国产日韩欧美精品电影三级在线| 国产精品区一区二区三区| 国产精品国产三级国产专播品爱网 | 免费成人小视频| 久久精品国产在热久久| 激情深爱一区二区| 成人精品gif动图一区| 91色porny蝌蚪| 6080日韩午夜伦伦午夜伦| 日韩三级视频在线看| 国产日产精品1区| 亚洲私人黄色宅男| 天天综合天天做天天综合| 久久99精品一区二区三区| 成人午夜电影久久影院| 在线视频欧美区| 精品少妇一区二区三区日产乱码| 久久精品亚洲精品国产欧美| 亚洲欧洲中文日韩久久av乱码| 午夜欧美视频在线观看| 久久69国产一区二区蜜臀| 不卡一区二区三区四区| 欧美三级蜜桃2在线观看| 日韩午夜激情av| 成人免费视频在线观看| 性欧美疯狂xxxxbbbb| 精品一区二区国语对白| 波多野结衣的一区二区三区| 欧美日韩一区二区三区在线看| 精品久久一二三区| 亚洲人成在线播放网站岛国| 蜜臀av性久久久久蜜臀aⅴ| 成人高清免费观看| 91精品国产色综合久久不卡蜜臀| 国产亚洲综合av| 午夜成人免费电影| 成人网在线免费视频| 欧美精品国产精品| 中文字幕中文字幕一区| 免费不卡在线观看| 日本黄色一区二区| 久久久久久夜精品精品免费| 午夜不卡av免费| av不卡一区二区三区| 亚洲精品在线电影| 五月天激情综合网| 色综合视频在线观看| 久久日韩粉嫩一区二区三区| 日本在线不卡视频| 在线观看中文字幕不卡| 国产欧美一区二区精品忘忧草| 视频一区视频二区中文字幕| 色婷婷综合久久久久中文一区二区 | 国产成人精品免费视频网站| 欧美久久久影院| 日韩美女视频一区| 国产成人啪免费观看软件| 欧美一卡二卡在线| 亚洲电影在线播放| 91美女蜜桃在线| 国产精品丝袜久久久久久app| 麻豆精品一区二区三区| 欧美日韩国产区一| 洋洋av久久久久久久一区| 成人高清视频在线| 国产欧美日韩综合精品一区二区| 久久99蜜桃精品| 日韩视频免费观看高清在线视频| 亚洲永久精品国产| 97久久人人超碰| 国产精品美女久久久久久| 国产精品一区二区视频| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲美女区一区| 99国产精品99久久久久久| 中文幕一区二区三区久久蜜桃| 国产一区二区三区免费| 精品久久久久一区二区国产| 美女任你摸久久| 精品美女在线观看| 国产精品18久久久久久久久| 久久久久久毛片| 成人免费高清视频| 一区二区中文视频| 91麻豆国产精品久久| 亚洲一区中文日韩| 欧美色图12p| 国产精品久久久久精k8| 制服丝袜av成人在线看| 亚洲一区自拍偷拍| 欧美日韩国产美| 日韩—二三区免费观看av| 91精品国产色综合久久ai换脸| 首页国产欧美日韩丝袜| 欧美一区二区大片| 国产九九视频一区二区三区| 国产欧美一二三区| 91在线观看美女| 亚洲午夜激情网页| 欧美年轻男男videosbes| 日韩高清一区二区| 久久婷婷久久一区二区三区| 国产99一区视频免费| 中文字幕在线免费不卡| 91久久精品一区二区| 日本网站在线观看一区二区三区| 日韩女优av电影| 成人一区二区三区视频在线观看| 亚洲视频图片小说| 精品视频1区2区| 久久91精品久久久久久秒播| 国产精品区一区二区三| 欧美图片一区二区三区| 蜜臀a∨国产成人精品| 国产欧美日本一区视频| 色嗨嗨av一区二区三区| 美日韩一级片在线观看| 中文字幕电影一区| 欧美三级三级三级| 国产精品一区二区不卡| 亚洲精品乱码久久久久久久久| 在线播放视频一区| 成人一级黄色片| 午夜在线成人av| 欧美极品aⅴ影院| 精品1区2区3区| 丁香六月综合激情| 午夜精品免费在线| 欧美高清在线一区二区| 欧美日韩黄视频| 成人国产一区二区三区精品| 午夜激情一区二区三区| 久久蜜桃av一区二区天堂| 在线亚洲一区观看| 国产麻豆午夜三级精品| 亚洲午夜免费福利视频| 久久久国际精品| 制服丝袜亚洲精品中文字幕| 成人精品视频一区| 久久99国产精品久久99| 亚洲一区在线免费观看| 亚洲国产精品二十页| 日韩欧美在线综合网| 色爱区综合激月婷婷| 国产乱码精品一区二区三区av| 亚洲h动漫在线| 亚洲人成亚洲人成在线观看图片 | 久久久久久麻豆| 7777女厕盗摄久久久| 色就色 综合激情|