- OCaml 4.09.x
- Node.js 10.x.x
- npm 6.9.x
- opium 0.18.0
(these instructions assume you have OCaml and opam installed to the directions in the CS 3110 course page)
-
You can install Node.js and npm by running
sudo apt update,sudo apt install nodejs, andsudo apt install npm.- IMPORTANT: Use the commands
node -vandnpm -vto verify that your versions are up to date. (known bug for WSL: you may have to executesudo npm install -g npmonce or twice (possibly restarting VSCode) even after installing it withsudo apt install npmif your version is way below 6.9.x.)
- IMPORTANT: Use the commands
-
Assuming you have the default CS 3110 OCaml
opaminstallations, you still have to install the opium package. Use the commandopam install opiumto install this dependency for the backend. -
Run
make buildallin the root directory (the folder this file is in). This will build all the necessary source code in the project.- This might take a couple minutes; sorry about that, our node project uses some modules we need to download. Rest assured though that you can delete the folder after you're done working with this game and all of the downloaded stuff will be gone.
The following commands are for use in the root directory (the folder this file is in)
-
make buildallbuilds everything in the app (compiles OCaml code + webapp dependencies) -
make runruns the app and OCaml backend. You must have runmake buildallprior to this for it to work- Alternatively, if you are having issues with this command, you might
want to try
make serverin one terminal window andmake webin another. If this doesn't work, your Node.js/npm version are probably out of date, or some weird OS bug is happening. (We hope this doesn't happen!)
- Alternatively, if you are having issues with this command, you might
want to try
-
make docsgenerates documentation folders for the OCaml code: a doc.public for the exposed functions and a doc.private for helpers/unexposed functions. -
make testevaluates the test cases in src/test.ml. -
make cleancleans the OCaml temp files out of the project. -
make playplays the game in command line mode (LEGACY, not intended method of gameplay)