Are these dice loaded?
Someone swears their die is fair. Read their rolls and draw a histogram, a bar chart with one bar per face, to check.
The starter's main reads numbers until the input runs out. Finish the tally: a roll from 1 to 6 adds 1 to that face's count in the .bss array tally (face 1 at index 0), and any other value adds 1 to ignored_r instead. Then finish the chart: the starter already prints each row's label f | and its line break, so print one # per roll in between.
tally holds ints, 4 bytes each, so entry i sits at tally + i * 4: the scaled form [tally_r, w9, SXTW 2] does that multiply for you.
The starter's input draws:
1 |#
2 |#
3 |###
4 |
5 |#
6 |###
ignored 0
What is checked
- the chart above
- the program exits with status 0
- the same checks on other inputs the checker keeps hidden: no rolls at all, values outside 1 to 6 (0, 7 and negatives), and a die that only ever rolls one face
- the counts are kept in memory (
str)
specification
strWe run your program on the input above and on the hidden ones, and compare what it does. Nothing is matched against a stored solution.