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

Finished Mine and Missile Distncesc

parent c0a2aad1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -87,7 +87,7 @@ define
fun{GenerateRow Length Acc}
if Length==0 then
Acc
elseif ({OS.rand} mod 4) \= 0 then
elseif ({OS.rand} mod 3) \= 0 then
{GenerateRow Length-1 0|Acc}
else
{GenerateRow Length-1 1|Acc}
......@@ -127,7 +127,7 @@ in
%%%% Life %%%%
MaxDamage = 4
MaxDamage = 8
%%%% Number of load for each item %%%%
......
......@@ -64,7 +64,7 @@ define
[] H|T andthen {P H} then
Rest={List.append {List.reverse Acc} T}
H
else
[] H|T then
{Aux T H|Acc}
end
end
......@@ -204,27 +204,18 @@ define
of nil then
ID=State.id KindFire=null
State
elseif {OS.rand} mod 2 == 0 then ToFire={GetRandomElement State.chargedItems} in
[] ToFire|T then
ID=State.id KindFire=ToFire
{System.show 'here KindFire='#KindFire}
case KindFire
of mine(1:Position) then
{System.show 'mine'}
Position={RandomValidMinePos State.pos}
{System.show 'mine KindFire='#KindFire}
{NewRec {NewRec State chargedItems {List.subtract State.chargedItems ToFire}} placedMines ToFire|State.placedMines}
{NewRec {NewRec State chargedItems T} placedMines ToFire|State.placedMines}
[] missile(1:Position) then
{System.show 'missile'}
Position={RandomValidMissilePos State.pos}
{System.show 'missike KindFire='#KindFire}
{NewRec State chargedItems {List.subtract State.chargedItems ToFire}}
{NewRec State chargedItems T}
else
{System.show 'else KindFire='#KindFire}
{NewRec State chargedItems {List.subtract State.chargedItems ToFire}}
{NewRec State chargedItems T}
end
else
ID=State.id KindFire=null
State
end
end
......@@ -276,7 +267,7 @@ define
proc{DeadTreatStream Stream State}
case Stream
of nil|T then skip
of nil|T then skip
[] initPosition(ID Pos)|T then
ID=null
{DeadTreatStream T State}
......@@ -439,7 +430,8 @@ define
{AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020hunter)
life:Input.maxDamage
pos:pt(x:0 y:0)
chargingItems:[ {GetNewChargeFireItem mine} {GetNewChargeFireItem missile} ]
chargingItems:[ {GetNewChargeFireItem mine} {GetNewChargeFireItem missile}
{GetNewChargeFireItem sonar} {GetNewChargeFireItem drone} ]
chargedItems:nil
placedMines:nil
history:nil)}
......
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