Java from First Principles - self-check kit
===========================================

This kit holds what you need to practise the lessons on your own computer and to
check your exercises. Every Part of the course has its own kit.

What you need
-------------
  * A JDK (Java Development Kit), so that `javac` and `java` work in a terminal.
    Test it: run `javac -version`.
  * Python 3, so that `python` (on macOS and Linux often `python3`) works in a
    terminal. Test it: run `python --version`.
  * Both have to be on your PATH. The course's opening page, "Start here", shows how.

Setting up
----------
Unzip the kit of every Part you read into the SAME folder, for example
`java-course`. The kits never overwrite each other's folders, so unzipping a later
Part is safe. But do not unzip the same kit a second time over work you want to
keep: that would put the starter files back.
Open a terminal in that folder. You should see check.py, README.txt and the
folders work, code and tests.

What is inside
--------------
  work/   one folder per exercise. Do your exercises here. Some folders hold
          starter files, some are empty and you create the files yourself.
  code/   the example programs that the lessons show, ready to run. The
          programs in the folders called broken are meant to fail to compile.
  tests/  what the checker needs. Do not open it (see below).
  check.py  the checker.

Checking an exercise
--------------------
In the lesson an exercise has a folder name such as `ex3-bug-hunt` under
module `m01`. Run:

    python check.py m01 ex3

The checker compiles your files, runs your program, compares its output with
what the exercise asks for, and prints what it found. Leave out the exercise to
check a whole module:

    python check.py m01

A checkpoint project is checked by its short name, and each milestone separately:

    python check.py pa m2

`python check.py pa` checks every milestone of checkpoint A at once.
The checker only says whether the program compiles, whether its output matches and
whether required files are there. Whether your solution is good and clear is for
you to judge with the lesson in front of you, so reread the exercise text after a
check. A solution that passes can still be improved, and one that is different
from the lesson's idea but passes is correct.

Please do not look inside tests/
--------------------------------
tests/ holds the programs and the expected output the checker compares with.
Reading them shows you what a correct answer must print before you have worked it
out yourself, and that takes away the exercise. Open that folder only when you are
stuck for good and have decided to give up on an exercise.

If a check says something you cannot make sense of, or fails although you are
sure your answer is right, that may be a mistake in the course. Tell the author.
