diff --git a/Input.oz b/Input.oz index 1fb664bfd2bd2a2d3ac340f9a0f99ab75e781eb3..7d7859ef0be12b0a0b8c2e9281efc07bfe7e5b53 100644 --- a/Input.oz +++ b/Input.oz @@ -8,6 +8,7 @@ export nColumn:NColumn map:Map nbPlayer:NbPlayers + nbPlayers:NbPlayers players:Players colors:Colors thinkMin:ThinkMin @@ -62,7 +63,7 @@ define fun{GenerateRow Length Acc} if Length==0 then Acc - elseif ({OS.rand} mod 3) \= 0 then + elseif ({OS.rand} mod 4) \= 0 then {GenerateRow Length-1 0|Acc} else {GenerateRow Length-1 1|Acc} @@ -92,9 +93,9 @@ in %%%% Players description %%%% - NbPlayers = 6 - Players = [player020random player020random player020hunter player020hunter player020hunter player020hunter] - Colors = [c(245 88 203) c(255 102 0) black green blue red] + NbPlayers = 2 + Players = [player020hunter player020hunter] + Colors = [c(245 88 203) c(255 102 0)] %%%% Surface time/turns %%%% @@ -128,7 +129,7 @@ in %%%% Description of the map %%%% -NRow = ({OS.rand} mod 5) + (NbPlayers+(NbPlayers div 2)) +NRow = ({OS.rand} mod 10) + (NbPlayers+(NbPlayers div 2)) NColumn = ({OS.rand} mod 10) + (NbPlayers *2) Map = {GenerateMap NRow NColumn nil} diff --git a/Player020Hunter.oz b/Player020Hunter.oz index 39e584a066c8ba66f06f6d9d039cf25d170c9d73..5e5eeca23ac2f57b121f6d5f04258bbd2aa0ef10 100644 --- a/Player020Hunter.oz +++ b/Player020Hunter.oz @@ -331,6 +331,7 @@ define [] sayMove(ID Direction)|T then NewState in %% Ignored {System.show 'Player'#State.id.id#'received'#sayMove(ID Direction)} NewState={HandleSayMove State State.enemies sayMove(ID Direction) nil} + {System.show 'Player'#State.id.id#'enemies'#NewState.enemies} {AliveTreatStream T NewState} [] isDead(Answer)|T then Answer=false @@ -376,7 +377,7 @@ define {AliveTreatStream T State} [] sayPassingDrone(drone(column Y) ID Answer)|T then {System.show 'Player'#State.id.id#'received'#sayPassingDrone(drone(column Y) ID Answer)} - ID=State.id.id + ID=State.id Answer=State.pos.y==Y {System.show 'Player'#State.id.id#'replied'#sayPassingDrone(drone(column Y) ID Answer)} {AliveTreatStream T State} @@ -384,7 +385,7 @@ define {System.show 'Player'#State.id.id#'received'#sayAnswerDrone(Drone ID Answer)} {AliveTreatStream T State} [] sayPassingSonar(ID Resp)|T then - ID=State.id.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) + ID=State.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) {System.show 'Player'#State.id.id#'received'#sayPassingSonar(ID Resp)} {AliveTreatStream T State} [] sayAnswerSonar(ID Answer)|T then %% Ignore @@ -424,7 +425,7 @@ define chargedItems:nil placedMines:nil targets:nil - enemies:{InitEnemies ID Input.nbPlayer nil} + enemies:{InitEnemies ID.id Input.nbPlayer nil} history:nil)} end Port diff --git a/Player020Random.oz b/Player020Random.oz index 3b32e0a0657eedeede59fc51792b0de1c30530ea..42942d2b51a74c47a8d9903c5d92f2280e2154e2 100644 --- a/Player020Random.oz +++ b/Player020Random.oz @@ -321,7 +321,7 @@ define {AliveTreatStream T State} [] sayPassingDrone(drone(column Y) ID Answer)|T then {System.show 'Player'#State.id.id#'received'#sayPassingDrone(drone(column Y) ID Answer)} - ID=State.id.id + ID=State.id Answer=State.pos.y==Y {System.show 'Player'#State.id.id#'replied'#sayPassingDrone(drone(column Y) ID Answer)} {AliveTreatStream T State} @@ -329,7 +329,7 @@ define {System.show 'Player'#State.id.id#'received'#sayAnswerDrone(Drone ID Answer)} {AliveTreatStream T State} [] sayPassingSonar(ID Resp)|T then - ID=State.id.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) + ID=State.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) {System.show 'Player'#State.id.id#'received'#sayPassingSonar(ID Resp)} {AliveTreatStream T State} [] sayAnswerSonar(ID Answer)|T then %% Ignore