A collection of past Cloudflight Coding Contest (CCC) challenges: the level statements, the input files, my Java solutions and the outputs they produce.
The framework around the solutions (file discovery, input/output handling, visualizer check) comes from cc-input-reader. That repository is the clean template for a single contest; this one collects everything that has been solved with it.
| Contest | Levels | Task | Solutions |
|---|---|---|---|
lawnmower (39th CCC) |
1–7 | Program a robotic lawn mower: evaluate given paths, then find a path that mows a lawn with one or more trees on it. | solver/lawnmower |
roomplanner (40th CCC) |
1–7 | Fill storage rooms with desks: count how many fit, then place them — later with other and mixed desk sizes. | solver/roomplanner |
spaceship (41st CCC) |
1–8 | Steer a spaceship with sequences of paces to a space station within a time limit, later around stationary and moving asteroids. | solver/spaceship |
nanofabricator (42nd CCC) |
1–6 | Write the software for FAB-42, which creates matter with lasers on a hexagonal board: draw the board, simulate emitter programs, then generate programs that build given patterns. Level 6 is an optimization level (fewest instruction lines). | solver/nanofabricator |
Requires JDK 21 and Maven. Always run from the repository root.
- Point
inputPathinconfig.xmlat the level folder, without a trailing slash:The solution class is derived from this path:<inputPath>./input/spaceship/level8</inputPath>
./input/spaceship/level8runssolver.spaceship.Level8. - Optionally restrict the files with
targetSpecificLevel:eruns only the example,-1every file in the folder. - Run:
mvn -q compile exec:java
Each input file produces one file in output/. Every non-empty output is also copied to
solutions/<contest>/levelN/, where nothing is ever deleted and only files of the same name are replaced.
Since that happens on every run, look at git diff before committing: a run with a half-finished solver
overwrites the stored solution as well.
To compare with the expected example output:
diff --strip-trailing-cr output/out_level-8_0-example.txt input/spaceship/level8/out_level-8_0-example.txt
Many later levels accept any valid answer, so a difference there does not mean the solution is wrong. That is what the visualizer is for.
Levels that accept several answers ship an HTML page (visualizer.html or sandbox-level-N.html) that
validates a solution. The framework can feed every test case into it with headless Chrome:
- Set
<visualizerPath>to the HTML file of the level and<enabled>true</enabled>in theverifierblock. - Adapt
verify()inSolver.javaso that it reads one test case from the input and the matching lines from the output. Unlikesolve(), it is not picked per level; it currently matches the later spaceship levels. - Run as above. Each output file gets a
.verfile next to it inoutput/with one line per test case.
Chrome has to be installed. See CLAUDE.md for the details and limits of the verifier.
- Unzip the level into
input/<contest>/levelN/. - Create
src/main/java/solver/<contest>/LevelN.javawith apublic static void solve(Scanner reader, FileWriter writer) throws IOException. - Set
inputPathto the new folder, run and upload the files fromoutput/. - Once the level is accepted, commit the solver together with
solutions/<contest>/levelN/.