Home
Theme

Languages

Code Treadmill supports several languages, each with its own exercise banks, supported question types, and testing format.

Here are some notes about each language

JavaScript

Code writing tests use: davidchambers/doctest

Python

Code writing tests use: Python doctest

Java

Code writing tests use a custom check() function that replicates the behavior of the C++ doctest framework. Hopefully it's pretty straight-forward!

C++

Code writing tests use a custom testing framework inspired by: C++ doctest.

AP Pseudocode

AP Pseudocode was created by the College Board for the AP Computer Science Principles exam. For official documentation from the College Board, see the Exam Reference Sheet. There are two versions of AP Pseudocode: text and blocks. On the test, students are only required to read code - there are no code-writing problems. To make AP Pseudocode runnable on Code-Treadmill, it is first converted to JavaScript. For more details, seeutils/jsToPseudoCode.jsBlock diagrams are powered by APML by Baker Franke.

Intel 8080 Assembly

Exercises are evaluated using 8080js by Martin Maly, an Intel 8080 CPU emulator in JavaScript. The emulator assembles and executes each snippet server-side and returns the accumulator value as the expected answer.

The Intel 8080 placeholder set includes assembly-specific tokens: #x# (hex byte in Intel notation, e.g. 1AH), #b# (binary string, e.g. 10110101), #h# (lowercase hex, e.g. b5), #o# (octal string, e.g. 265).

Math

Math exercises present number-base conversion and arithmetic problems using randomized values. Students type the numeric answer directly.

HTML/CSS

HTML/CSS exercises use a unique live-preview format — the student edits a snippet and a side-by-side preview updates in real time. See Question Types for details on validation, target screenshots, and sandbox constraints.