-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
106 lines (80 loc) · 4.14 KB
/
INSTALL.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
WELCOME TO DuckDebug!
Instructions for Running and Playing the Game:
Game objective: Write code to move agent on a grid and achieve the indicated
winning state.
- After you unzip navigate to the directory of the Makefile to run the game
the following libraries are required:
- lablgtk3
- yojson
- str
- thread
- dune
- bisect_ppx
- ocamllex
- menhir
- Please install them using the "opam install" command.
- If any of them fails due to unmet system dependencies, install any program
required by the system using the "apt-get install" command. For example,
lablgtk3 requirements can be installed with
-"sudo apt-get install libcairo2-dev libexpat1-dev libgtk-3-dev"
- If you are on windows WSL you must download an X-server to support graphical
applications based on Linux. You can check this ubuntu wiki page for further
option: "https://wiki.ubuntu.com/WSL#Running_Graphical_Applications"
- On command shell, type "make build". This should successfully build the
application with dune if everything is installed correctly.
- Now you can choose between running "make cli" or "make gui" which would
build and run the corresponding command line of graphical user interface.
- When prompted to pick level, enter "1", "2", "3", "4" or "5". A supplemental
documentation explaining each level and their solutions are added as a
"solutions.pdf" in the project directory.
- To write code that would solve the given task, either write it in the textbox
on the lower left corner or the terminal in cli. It is possible to come up
with long or short solutions to the level but there are certain limits on how
long the solution can be. Shorter solutions are worth more points.
The goal of the game is to draw the image displayed on the right grid.
- After entering code, follow the onscreen elements to run the game.
- Simulation will terminate with the appropriate message, either when you
achieve the winning state, or your code terminates in a non-winning state.
You can press "q" in the cli or "quit" button in the gui at any time during
the simulation stage to quit.
Game language syntax:
'M' - Move Forward
'R' - Turn Right
'L' - Turn Left
'1' - Color Square Red
'2' - Color Square Green
'3' - Color Square Blue
'f =' - Define Function f
'f -x -y = xy' - Define f with two arguments x and y that concatanates them
'[f]' - Call Function f
'[f -MRMRL -RRR]' - apply f with two arguments
';' - Separator between definitions.
All function definitions must be declared before any commands.
Example valid code entries:
"MMR1MML2MM" -> Move sequence to execute.
"f=MMR1MML2MM;[f]" -> Defines function f, then calls it.
"g=MML2;f=MMR1[g]MM;[f]" -> Defines functions g and f, (definition of f uses
application of g), calls f.
"f=MMR1[f];[f]" -> Defines recursive function f, and calls it. (Infinite
recursion is allowed, game will terminate if winning state is achieved at any
point during the execution. We used streams to enable player code to provide
infinite move sequences.)
"f -x = xR[f -xM]; [f -M]" -> outputs MRMMRMMMRMMMMR...
Comments on documentation:
- Running the make docs command produces documentation under the folder
"_build/default/_doc/_html/index.html". Since we are using dune as a build
system, we use odoc to generate documentation. For some reason even though
we dont have a module named project odoc generates a index file named
project which can be ignored. We don't have an entry in our documentation as
app.ml is a 2line script that executes the code and is not a part of our
public signatures.
- We seperated our module into sub directories and therefore we access
functions via their full path in our code (Ex. Interpreter.Eval.parse).
Therefore in the documentation, interpreter for example does not have a
comments as it is made out of further sub modules. Each module, however,
does have a documentation when you click on the hyperlink.
Comments on project:
- The configuration for bisect for dune was written using the code provided
in the bisect github repository.
- The inspiration for this game and the level desing came from a similar game
language called herbert.