Exercises and projects for Jane Street's OCaml Workshop
This repo contains exercises and build instructions to help you get started developing in OCaml.
#+BEGINSRC bash cd 02-exercises/$problemdir
dune runtest # builds and runs inline tests # Look at test output and compiler errors, edit problem.ml, rerun: dune runtest #+END_SRC * Snake, Lumines, and Frogger Once you're done with the exercises, you can also implement simplified clones of the following arcade games:
One library for writing code in this style is [[https://opensource.janestreet.com/async/][Async]]. [[https://ocaml.janestreet.com/ocaml-core/latest/doc/async/index.html][Async]] provides ~Reader~ and ~Writer~ abstractions for I/O which, paired with the [[https://ocaml.janestreet.com/ocaml-core/latest/doc/asyncextra/Asyncextra/Tcp/][Tcp]] module should have most of what you need for either of the projects below.
Before proceeding, it would probably be a good idea to read [[https://dev.realworldocaml.org/18-concurrent-programming.html][Chapter 18]] of /Real World OCaml/. There is some example code in the next section which should set you on your way. * Bigger projects Once you've made it to this point, there are a few possible paths laid out for you:
Or, if you want, you can continue making improvements and extensions to your version of Frogger (see the [[file:03-frogger][frogger README]] for some ideas).