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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? deb1d0~1.cpp

?? 游戲的聲音圖像演示程序
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
                          // scan for a "hot" cell
                          float max_energy = 0;
                          int cell_x = 0, cell_y = 0;
                        
                          for (int index_x = 0; index_x < 16; index_x++)
                              for (int index_y = 0; index_y < 16; index_y++)
                                  // does this cell have more food?
                                  if (ants_mem[index].cell[index_x][index_y] > max_energy)
                                     {
                                     // update new max
                                     max_energy = ants_mem[index].cell[index_x][index_y]; 
                                     cell_x = index_x; cell_y = index_y;

                                     } // end if

                          // test max and see if we have a winner?
                          if (max_energy > 0)
                             {
                             // vector to this cell
                            ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = ANT_SEARCH_FOOD_S3_VECTOR_2CELL;

                            // send to cell center
                            ants[index].varsI[ANT_INDEX_FOOD_TARGET_X] = 30*cell_x+15;
                            ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y] = 30*cell_y+15;                              

                            // set counters to 0
                            ants[index].counter_1 = ants[index].counter_2 = 0;                           

                             } // end if
                           else
                              { 
                              // go into wander mode, no knowledge of food
                              // vector to this cell
                              ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = ANT_SEARCH_FOOD_S2_WANDER;

                              // set counters 
                              ants[index].counter_1 = RAND_RANGE(100,150);
                              ants[index].counter_2 = 0;  

                              } // end else

                          } break;

                     case ANT_SEARCH_FOOD_S2_WANDER:
                          {
                          // wander and look for food, when done wandering go back and scan
                             
                          // burn food
                          ants[index].varsI[ANT_INDEX_HUNGER_LEVEL]+=1; 

                          // move the ant
                          ants[index].x+=ant_movements_x[ants[index].varsI[ANT_INDEX_DIRECTION]];
                          ants[index].y+=ant_movements_y[ants[index].varsI[ANT_INDEX_DIRECTION]];

                          // test if ant is done with direction and needs a new one
                          if (--ants[index].counter_2 < 0)
                             {
                             // set direction
                             ants[index].varsI[ANT_INDEX_DIRECTION] = RAND_RANGE(ANT_ANIM_UP, ANT_ANIM_LEFT);
    
                             // time in this new direction
                             ants[index].counter_2 = RAND_RANGE(10, 100);

                             // start animation
                             Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);

                             } // end if new direction

                            // update memory with presence of food
                            int ant_cell_x = ants[index].x / 30;
                            int ant_cell_y = ants[index].y / 30;

                            // this updates the i,jth memory cell in ant with info about food
                            float food_near_ant = Food_Near_Ant(ant_cell_x, ant_cell_y);
                            
                            ants_mem[index].cell[ant_cell_x][ant_cell_y] =
                                 ANT_MEMORY_RESIDUAL_RATE*ants_mem[index].cell[ant_cell_x][ant_cell_y] + 
                                 (1-ANT_MEMORY_RESIDUAL_RATE)*food_near_ant;

                            // test if we just bumped into some food
                            if (food_near_ant > 0)
                               {
                               // find highest source of food
                               int food_x = -1;
                               int food_y = -1;

                               // find the highest food source in cell
                               int food_id = Max_Food_In_Cell(ant_cell_x, ant_cell_y, &food_x, &food_y);
                                                         
                               // pre-empt into vector 2 food
                               ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = 
                                                                   ANT_SEARCH_FOOD_S4_VECTOR_2FOOD;

                               // send to exact position
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_X] = food_x;
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y] = food_y;
                                                                  
                               // set target id of food
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_ID] = food_id;

                               // set counters to 0
                               ants[index].counter_1 = ants[index].counter_2 = 0;

                               } // end if
                            
                            // test if we are done with this state and need to go back to scan
                            else
                            if (--ants[index].counter_1 < 0)                                        
                               {
                               // go back to scan state                            
                               ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = ANT_SEARCH_FOOD_S1_SCAN;                            

                               } // end if
             

                          } break;

                     case ANT_SEARCH_FOOD_S3_VECTOR_2CELL: 
                          {
                          // this substate vectors the ant to the center of the cell, once
                          // there the ant "looks" to see if there actually is any food, if so
                          // vectors to it, else goes back and scans

                          // burn food
                          ants[index].varsI[ANT_INDEX_HUNGER_LEVEL]+=2;

                          // pick direction
                          int dx = ants[index].varsI[ANT_INDEX_FOOD_TARGET_X] - ants[index].x;
                          int dy = ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y] - ants[index].y;
                   
                         // pick maxium delta to move in
                         if (abs(dx) >= abs(dy))
                            {
                            // x dominate
                            if (dx > 0)
                               {
                               // move right 
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_RIGHT)
                                  {
                                  // start animation right
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_RIGHT;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if
                               ants[index].x+=ant_movements_x[ants[index].varsI[ANT_INDEX_DIRECTION]];
                               } // end if                             
                            else
                            if (dx < 0)
                               {
                               // move left
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_LEFT)
                                  {
                                  // start animation left
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_LEFT;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if
                                  ants[index].x+=ant_movements_x[ants[index].varsI[ANT_INDEX_DIRECTION]];

                               } // end else

                            } // end if x
                         else
                            {
                            // y dominate
                            if (dy > 0)
                               {
                               // move down
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_DOWN)
                                  {
                                  // start animation down
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_DOWN;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                               ants[index].y+=ant_movements_y[ants[index].varsI[ANT_INDEX_DIRECTION]];
                               } // end if                             
                            else
                            if (dy < 0)
                               {
                               // move up
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_UP)
                                  {
                                  // start animation down
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_UP;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                                 ants[index].y+=ant_movements_y[ants[index].varsI[ANT_INDEX_DIRECTION]];
                               } // end else

                            } // end else

                          // update memory image ????

                            // update memory with presence of food
                            int ant_cell_x = ants[index].x / 30;
                            int ant_cell_y = ants[index].y / 30;

                            // this updates the i,jth memory cell in ant with info about food
                            float food_near_ant = Food_Near_Ant(ant_cell_x, ant_cell_y);
                            
                            ants_mem[index].cell[ant_cell_x][ant_cell_y] =
                                 ANT_MEMORY_RESIDUAL_RATE*ants_mem[index].cell[ant_cell_x][ant_cell_y] + 
                                 (1-ANT_MEMORY_RESIDUAL_RATE)*food_near_ant;

                          // now test if target reached
                          if (abs(ants[index].x - ants[index].varsI[ANT_INDEX_FOOD_TARGET_X]) < 4 &&
                              abs(ants[index].y - ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y]) < 4)
                             {
                             // center of cell reached, now find the biggest piece of food and
                             // vector to it, if none exist then go back to scan

                            // compute cell position
                            int ant_cell_x = ants[index].x / 30;
                            int ant_cell_y = ants[index].y / 30;

                            // this updates the i,jth memory cell in ant with info about food
                            float food_near_ant = Food_Near_Ant(ant_cell_x, ant_cell_y);
                            
                            // test if we just bumped into some food
                            if (food_near_ant > 0)
                               {
                               // find highest source of food
                               int food_x = -1;
                               int food_y = -1;

                               // find the highest food source in cell
                               int food_id = Max_Food_In_Cell(ant_cell_x, ant_cell_y, &food_x, &food_y);
                                                         
                               // pre-empt into vector 2 food
                               ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = 
                                                      ANT_SEARCH_FOOD_S4_VECTOR_2FOOD;

                               // send to exact position
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_X] = food_x;
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y] = food_y;
                                                                  
                               // set target id of food
                               ants[index].varsI[ANT_INDEX_FOOD_TARGET_ID] = food_id;

                               // set counters to 0
                               ants[index].counter_1 = ants[index].counter_2 = 0;

                               } // end if
                            else
                               {
                               // set mode to scan
                               ants[index].varsI[ANT_INDEX_AI_SUBSTATE] = ANT_SEARCH_FOOD_S1_SCAN;                            
                               } // end else
 
                             } // end if

                          } break;


                     case ANT_SEARCH_FOOD_S4_VECTOR_2FOOD:
                          {
                          // this substate vectors the ant to the exact x,y of the food 
                          // once there, tests to see if there is food there, if so eats it,
                          // else go to scan
                             
                          // burn food
                          ants[index].varsI[ANT_INDEX_HUNGER_LEVEL]+=2;

                          // pick direction
                          int dx = ants[index].varsI[ANT_INDEX_FOOD_TARGET_X] - ants[index].x;
                          int dy = ants[index].varsI[ANT_INDEX_FOOD_TARGET_Y] - ants[index].y;
                   
                         // pick maxium delta to move in
                         if (abs(dx) >= abs(dy))
                            {
                            // x dominate
                            if (dx > 0)
                               {
                               // move right 
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_RIGHT)
                                  {
                                  // start animation right
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_RIGHT;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                               ants[index].x+=ant_movements_x[ants[index].varsI[ANT_INDEX_DIRECTION]];

                               } // end if                             
                            else
                            if (dx < 0)
                               {
                               // move left
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_LEFT)
                                  {
                                  // start animation left
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_LEFT;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                                ants[index].x+=ant_movements_x[ants[index].varsI[ANT_INDEX_DIRECTION]];

                               } // end else

                            } // end if x
                         else
                            {
                            // y dominate
                            if (dy > 0)
                               {
                               // move down
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_DOWN)
                                  {
                                  // start animation down
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_DOWN;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                               ants[index].y+=ant_movements_y[ants[index].varsI[ANT_INDEX_DIRECTION]];

                               } // end if                             
                            else
                             if (dy < 0)   
                               {
                               // move up
                               if (ants[index].varsI[ANT_INDEX_DIRECTION] != ANT_ANIM_UP)
                                  {
                                  // start animation down
                                  ants[index].varsI[ANT_INDEX_DIRECTION] = ANT_ANIM_UP;
                                  Set_Animation_BOB(&ants[index], ants[index].varsI[ANT_INDEX_DIRECTION]);
                                  } // end if

                                ants[index].y+=ant_movements_y[ants[index].varsI[ANT_INDEX_DIRECTION]];

                               } // end else

                            } // end else

                          // update memory image ????

                            // update memory with presence of food
                            int ant_cell_x = ants[index].x / 30;
                            int ant_cell_y = ants[index].y / 30;

                            // this updates the i,jth memory cell in ant with info about food
                            float food_near_ant = Food_Near_Ant(ant_cell_x, ant_cell_y);
                            
                            ants_mem[index].cell[ant_cell_x][ant_cell_y] =
                                 ANT_MEMORY_RESIDUAL_RATE*ants_mem[index].cell[ant_cell_x][ant_cell_y] + 
                                 (1-ANT_MEMORY_RESIDUAL_RATE)*food_near_ant;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜视频一区在线观看| 国产精品嫩草久久久久| 国产乱子轮精品视频| 五月婷婷激情综合网| 国产午夜精品一区二区三区视频| 91黄视频在线观看| 福利一区福利二区| 日韩高清国产一区在线| 国产精品成人一区二区艾草| 欧美一区二区三区性视频| 色婷婷精品久久二区二区蜜臂av| 国内成人精品2018免费看| 亚洲影院理伦片| 久久嫩草精品久久久精品| 91蜜桃在线观看| 国产精品1区2区3区在线观看| 另类人妖一区二区av| 亚洲最新在线观看| 国产精品九色蝌蚪自拍| 国产精品色噜噜| 国产精品欧美经典| 亚洲欧美日韩中文字幕一区二区三区| 国产欧美日韩精品一区| 中文字幕久久午夜不卡| 亚洲精品大片www| 不卡av免费在线观看| 色综合久久久久久久| 欧美日本韩国一区二区三区视频 | 久久99久久99| 国产在线乱码一区二区三区| 国产高清在线精品| 欧洲av一区二区嗯嗯嗯啊| 欧美日韩一区二区在线观看| 欧美一区二区日韩一区二区| 久久久国产午夜精品| 最新日韩av在线| 91小视频在线免费看| 日韩欧美aaaaaa| 亚洲九九爱视频| 免费精品99久久国产综合精品| 精品亚洲国产成人av制服丝袜| av在线播放不卡| 欧美mv和日韩mv的网站| **性色生活片久久毛片| 激情成人综合网| 91黄色激情网站| 国产精品视频免费看| 偷拍自拍另类欧美| 色999日韩国产欧美一区二区| 精品国免费一区二区三区| 亚洲国产成人av| 色噜噜夜夜夜综合网| 中文字幕一区二区不卡| 欧美视频在线一区| 亚洲一线二线三线视频| 成人国产亚洲欧美成人综合网| 欧美tickling挠脚心丨vk| 天天做天天摸天天爽国产一区| 色综合视频一区二区三区高清| 国产精品入口麻豆原神| 国产精品一区二区三区网站| 91麻豆精品91久久久久久清纯| 一区二区三区视频在线看| 本田岬高潮一区二区三区| 欧美国产精品一区| 国产精品77777竹菊影视小说| 久久综合色鬼综合色| 玖玖九九国产精品| 日韩欧美成人激情| 高清国产一区二区| 亚洲欧洲av一区二区三区久久| 成人a免费在线看| 亚洲欧美激情在线| 欧美午夜片在线观看| 秋霞电影网一区二区| 久久综合久久久久88| 国产精品一区久久久久| 亚洲欧美激情视频在线观看一区二区三区 | 日本韩国欧美在线| 亚洲高清免费一级二级三级| 欧美一区二区在线免费播放| 麻豆国产精品官网| 国产欧美日韩精品一区| 99视频热这里只有精品免费| 成人黄色在线视频| 日韩精品一级中文字幕精品视频免费观看| 91超碰这里只有精品国产| 狠狠网亚洲精品| 亚洲mv在线观看| 六月婷婷色综合| 精品嫩草影院久久| 香蕉影视欧美成人| 久久久av毛片精品| 精品婷婷伊人一区三区三| 久久超碰97人人做人人爱| 国产精品久久久久久久久快鸭| 欧美日韩免费一区二区三区视频| 激情文学综合插| 蜜芽一区二区三区| 欧美日本免费一区二区三区| 国产女同互慰高潮91漫画| 欧美一区二区黄| 欧美成人精品3d动漫h| 精品国产免费人成电影在线观看四季| 欧美精品v国产精品v日韩精品| 欧美亚洲综合色| 成人免费观看视频| 日本中文字幕一区二区视频| 亚洲精品视频免费观看| 国产欧美日本一区二区三区| 日韩一区二区三区免费观看 | 亚洲午夜视频在线| 中文字幕欧美国产| 欧美成人一区二区三区| 欧美日韩一区二区在线观看视频 | 日本高清不卡一区| 91丝袜美腿高跟国产极品老师| 欧美美女一区二区在线观看| 在线欧美日韩国产| 欧美一区二区视频网站| 欧美va日韩va| 国产精品视频九色porn| 综合婷婷亚洲小说| 一区二区三区在线视频播放| 亚洲摸摸操操av| 亚洲成a人v欧美综合天堂| 日本美女一区二区三区视频| 看片的网站亚洲| 久久国产三级精品| 99久久精品国产一区二区三区| 99久久精品国产麻豆演员表| 欧美色精品天天在线观看视频| 欧美日韩精品二区第二页| 精品毛片乱码1区2区3区| 中文字幕免费观看一区| 玉足女爽爽91| 久久精品国产精品亚洲综合| 国产成人高清在线| 欧美做爰猛烈大尺度电影无法无天| 欧美日韩另类国产亚洲欧美一级| 日韩一级片网站| 中文字幕视频一区| 韩国视频一区二区| 欧美日韩精品一区二区三区蜜桃| 国产精品视频免费看| 国产精品中文字幕一区二区三区| 欧美日本一区二区在线观看| 精品国产一区二区三区忘忧草 | 国产一区二区不卡在线| 国产不卡在线播放| 日韩免费观看高清完整版| 青青草一区二区三区| 国产一区二区三区免费在线观看| 91亚洲国产成人精品一区二区三| 精品视频一区二区三区免费| 欧美tk—视频vk| 亚洲一区二区三区小说| 国产精品一品二品| 国产欧美综合在线| 亚洲一区二区免费视频| 在线观看日韩精品| 亚洲国产日韩在线一区模特| 欧美日韩国产影片| 日本在线不卡一区| 日韩情涩欧美日韩视频| 国产一区在线精品| 国产精品久久福利| 欧美三级日韩三级| 精品在线观看免费| 国产免费久久精品| 波波电影院一区二区三区| 亚洲国产一二三| 99久久综合色| 中文字幕制服丝袜成人av| 国产91精品在线观看| 国产色爱av资源综合区| 国内不卡的二区三区中文字幕| 欧美一区欧美二区| 日韩黄色免费电影| 日韩一级二级三级精品视频| 日韩成人精品在线观看| 日韩一级免费一区| 国精产品一区一区三区mba视频 | 日韩欧美国产精品| 久久99久久精品| 国产精品免费av| 91免费观看在线| 日韩专区一卡二卡| 2021国产精品久久精品| 福利电影一区二区| 综合色中文字幕| 色美美综合视频| 日韩精品91亚洲二区在线观看 | 懂色一区二区三区免费观看| 国产日韩精品一区二区浪潮av | 在线精品视频小说1| 《视频一区视频二区| 日韩午夜在线观看| 成熟亚洲日本毛茸茸凸凹| 偷拍亚洲欧洲综合|