Our old arcade cabinet saves its high scores as raw bytes, and
the screen that showed them is broken. Tell me who is on top.
The cabinet compares the bytes directly, so do it that way.
Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
Notes
Each score is eight bits in one array, back to back, so score 2 starts at position 8. Store them as ints, not text.
Compare the bytes directly means do not convert them to numbers to find the winner. Use the deck's rule from 2.14: compare from the left, and the first place where they differ decides it.
Write a method that takes the start positions of two scores and returns whether the first is bigger.
Then convert each score to decimal by adding up its place values, and print them, as a check on your comparison.
In your requirements list, say what your method returns when two scores are equal, and why that is the right choice.
Sample Output
Sample Output
Top score: CAT
ACE: 178
BOB: 175
CAT: 180
DEE: 127
Find the winner by hand before you run it. ACE and CAT agree for the first five bits.
Submit
Your requirements list and your program file, named cc-byte-leaderboard.