-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.oz
34 lines (33 loc) · 878 Bytes
/
Main.oz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
functor
import
Input
Initialisation
TurnByTurn
Simultaneous
define
CreateItemsMap
in
fun{CreateItemsMap ItemsPositions}
case ItemsPositions
of nil then nil
[] H|T then H#enable|{CreateItemsMap T}
end
end
thread
{Initialisation.initialisation} {Delay 30000}
local WindowPort=Initialisation.windowPort
Pacmans=Initialisation.pacmansMapping
Ghosts=Initialisation.ghostsMapping
Points={CreateItemsMap Initialisation.pointsSpawns}
Bonus={CreateItemsMap Initialisation.bonusSpawns}
in
if Input.isTurnByTurn then
{TurnByTurn.turnByTurn WindowPort Pacmans Ghosts Points Bonus}
{Send WindowPort displayWinner(TurnByTurn.winner.1)}
else
{Simultaneous.simultaneous WindowPort Pacmans Ghosts Points Bonus}
{Send WindowPort displayWinner(Simultaneous.winner.1)}
end
end
end
end