Skip to content
Extraits de code Groupes Projets
Valider 28011ad5 rédigé par Vany Ingenzi's avatar Vany Ingenzi
Parcourir les fichiers

Fixes again for interpolability

parent 637df990
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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}
......
......@@ -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
......
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter