Paxos in 25 Lines
<p><pre><code>    1	proposer(v):
    2    while not decided:
    2	    choose n, unique and higher than any n seen so far
</code></pre>
26 lines.<p>It's pseudocode, so not really only 26 lines as it needs some more supporting functions to "choose n, unique and..." and other stuff to make setting variable states atomic.<p>Good way to explain the algo though.