Grade a lab part
spimbot grade runs a lab part's match with your bot as bot 0, then grades bot 0:
spimbot grade part1.s --part part1 --seed 5
Seed: 5
Test Points Details
Leave your territory 5/5
Complete a trail 0/5 Bring a trail back onto your own territory
Own 100 tiles 0.9/10 Tiles owned at the end, home base included: 9
Total 5.9/20
A test short of full marks shows details: what earns its points, or your bot's count for a progress test.
The match runs under the part's mode and cycle limit: 300,000 cycles for onboarding and 10,000,000 for the other parts. --seed picks the seed, random by default, and the text output starts with the seed in use. part1, part2 and onboarding run without tournament rules, so syscalls and exception handlers work. --against adds an opponent as bot 1:
spimbot grade part2.s --against opponent.s --part part2 --seed 11
To watch the graded match, open the debugger with the same seed, mode and cycle limit:
spimbot part2.s opponent.s --mode part2 --seed 11
grade lists every option.
Grade the qualification round
#The qualification part plays your bot against the built-in adversary, named adversary, under tournament rules: syscalls do nothing, and a crash forfeits the match. It takes no --against:
spimbot grade spimbot.s --part qualification --seed 11
Your bot passes by winning the match. A tie or a loss fails.
Tests
#MMIO devices describes the devices the tests name.
| Part | Test | Points | Earns its points |
|---|---|---|---|
part1, part2 |
Leave your territory | 5 | Pass or fail: paint a trail tile off your own territory |
part1, part2 |
Complete a trail | 5 | Pass or fail: bring a trail back onto your own territory |
part1, part2 |
Own 100 tiles | 10 | Progress: tiles owned at the end, target 100 |
part2 |
Request a puzzle | 10 | Pass or fail: write a valid buffer address to REQUEST_PUZZLE |
part2 |
Acknowledge a puzzle | 10 | Pass or fail: write any value to REQUEST_PUZZLE_ACK |
part2 |
Solve a puzzle | 40 | Pass or fail: write the address of a correct solution to SUBMIT_SOLUTION |
onboarding |
Set the timer | 5 | Pass or fail: write a cycle to TIMER to request an interrupt |
onboarding |
Acknowledge the timer interrupt | 5 | Pass or fail: write to TIMER_ACK |
onboarding |
Move 20 pixels down | 10 | Progress: pixels the bot's center ends below its base's center, target 20 |
qualification |
Beat the adversary | 100 | Pass or fail: win the match against the adversary |
A pass or fail test gives all its points once the bot does what it asks, at any point in the match, except Beat the adversary, which the match's result decides. A progress test gives points × min(count, target) / target, from the count at the end of the match. Tile counts include the bot's 9-tile home base.
Produce PrairieLearn's results.json
#--json prints the grade as the results.json object that PrairieLearn's autograder reads, and nothing else on standard output. --image adds the final map as a PNG:
spimbot grade spimbot.s --part qualification --json --image > results.json
The object holds a score from 0 to 1 and each test's points. grade --json lists every field.
grade exits with code 0 whatever the marks.