A tool to simulate the rank variation of a player in the french ladder after a go tournament. Enter your initial rank, your opponents and the results, and you get a report with the variation after each match. There are two interfaces: a CLI and a simple android application.
This started out as an Ocaml exercise, then I wanted to make it usable through a minimalistic android application. This was achieved by compiling the Ocaml bytecode into javascript stubs with js_of_ocaml and binding them to the java code of the mobile app.
You need an Ocaml compiler and a couple libraries that can be installed via opam. First install the base standard library and dune to be able to build the OCaml code:
opam install base dune
For the command line executable, the following ocaml libraries are used:
- cohttp to fetch the ladder file from http://ffg.jeudego.org
- lwt as asynchronicity backend for cohttp
- uutf to decode the ladder file that is encoded in latin-1
- stdio to print the results
opam install lwt cohttp cohttp-lwt-unix uutf stdio
Then build the executable:
make cli
It can be found at ocaml/_build/default/bin/ffg_ladder.exe
.
To build the mobile app, you need the android SDK and gradle. Once you have a working installation, install js_of_ocaml which is needed to generate the OCaml to javascript binding:
opam install js_of_ocaml js_of_ocaml-ppx
Then you can obtain a debug APK by running:
make android
The APK is created at android/app/build/outputs/apk/debug/app-debug.apk