From 28011ad5fc8325daa3b28d0a5d86f20ed45a2c12 Mon Sep 17 00:00:00 2001
From: Vany Ingenzi <ingenzi@intel17.info.ucl.ac.be>
Date: Mon, 13 Dec 2021 09:49:09 +0100
Subject: [PATCH] Fixes again for interpolability

---
 Input.oz           | 11 ++++++-----
 Player020Hunter.oz |  7 ++++---
 Player020Random.oz |  4 ++--
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Input.oz b/Input.oz
index 1fb664b..7d7859e 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 39e584a..5e5eeca 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 3b32e0a..42942d2 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
-- 
GitLab