Huffman Rover

Practise Huffman coding for Cambridge AS & A Level Computer Science 9618 as the rover decodes one movement command at a time.

Reach the beacon with the shortest valid bitstream.
Incoming bitstream
26 bits
decoder
reads here
Ready to decode.

Mars survey sector

The rover begins facing east. Rocks are impassable.

Bitstream score

Current valid route
26 bits
73%
7 bits above the shortest possible bitstream of 19 bits.

Program the rover

Every command moves one square after the indicated turn.

Huffman codebook

A code must not begin another code: this lets the decoder recognise where each command ends.
F
Forwardused 0 times
L
Leftused 0 times
R
Rightused 0 times
B
Backused 0 times
Valid prefix-free codebook.