some fixes

This commit is contained in:
Gnieark 2016-07-25 19:01:38 +02:00
parent aced31b12c
commit 60c95835a4
2 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
1579 1591

View File

@ -75,7 +75,7 @@ class TronGame
foreach($this->bots as $bot){ foreach($this->bots as $bot){
$trailsArr[] = $bot->trail->getTrailAsArray(); $trailsArr[] = $bot->trail->getTrailAsArray();
} }
return json_encode($trailsArr); return $trailsArr;
} }
public function new_lap(){ public function new_lap(){
// for all alive bots // for all alive bots
@ -104,7 +104,7 @@ class TronGame
} }
$responses = $this->get_multi_IAS_Responses($urls,$paramsToSend); $responses = $this->get_multi_IAS_Responses($urls,$paramsToSend);
print_r($responses); //print_r($responses);
//grow bots'tails //grow bots'tails
for ($botCount = 0; $botCount < $nbeBots; $botCount++){ for ($botCount = 0; $botCount < $nbeBots; $botCount++){
if ($this->bots[$botCount]->isAlive){ if ($this->bots[$botCount]->isAlive){
@ -120,7 +120,7 @@ class TronGame
for ($botCount = 0; $botCount < $nbeBots; $botCount++){ for ($botCount = 0; $botCount < $nbeBots; $botCount++){
if ($this->bots[$botCount]->isAlive){ if ($this->bots[$botCount]->isAlive){
foreach($this->bots as $otherBot){ foreach($this->bots as $otherBot){
if($otherBot->trail->contains($lastsCells($botCount))) if($otherBot->trail->contains($lastsCells[$botCount]))
$loosers[] = $botCount; $loosers[] = $botCount;
$this->bots[$botCount]->loose(); $this->bots[$botCount]->loose();
break; break;