GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - zor-cell/cc-contests: My solutions to the past Cloudflight Coding Contests

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
input
input
 
 
solutions
solutions
 
 
src/main
src/main
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Cloudflight Coding Contests

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.

Contests

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

Running a level

Requires JDK 21 and Maven. Always run from the repository root.

  1. Point inputPath in config.xml at the level folder, without a trailing slash:
    <inputPath>./input/spaceship/level8</inputPath>
    The solution class is derived from this path: ./input/spaceship/level8 runs solver.spaceship.Level8.
  2. Optionally restrict the files with targetSpecificLevel: e runs only the example, -1 every file in the folder.
  3. 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.

Checking a solution with the visualizer

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:

  1. Set <visualizerPath> to the HTML file of the level and <enabled>true</enabled> in the verifier block.
  2. Adapt verify() in Solver.java so that it reads one test case from the input and the matching lines from the output. Unlike solve(), it is not picked per level; it currently matches the later spaceship levels.
  3. Run as above. Each output file gets a .ver file next to it in output/ with one line per test case.

Chrome has to be installed. See CLAUDE.md for the details and limits of the verifier.

Adding a level

  1. Unzip the level into input/<contest>/levelN/.
  2. Create src/main/java/solver/<contest>/LevelN.java with a public static void solve(Scanner reader, FileWriter writer) throws IOException.
  3. Set inputPath to the new folder, run and upload the files from output/.
  4. Once the level is accepted, commit the solver together with solutions/<contest>/levelN/.

About

My solutions to the past Cloudflight Coding Contests

Topics

cloudflight-coding-contestcompetitive-programming

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.