Index: src/0dev.org/commands/plaindiff/main.go ================================================================== --- src/0dev.org/commands/plaindiff/main.go +++ src/0dev.org/commands/plaindiff/main.go @@ -31,11 +31,11 @@ for have, added, mark := gen(); have; have, added, mark = gen() { var from []line = hd.line(!added) fmt.Fprintln(out) for i := mark.From; i < mark.Length; i++ { - fmt.Fprint(out, i) + fmt.Fprint(out, i+1) // Line numbers start from 1 for most people :) if added { fmt.Fprint(out, " > ") } else { fmt.Fprint(out, " < ") } Index: src/0dev.org/encoding/fibonacci/fib.go ================================================================== --- src/0dev.org/encoding/fibonacci/fib.go +++ src/0dev.org/encoding/fibonacci/fib.go @@ -55,14 +55,21 @@ // Returns an integer from a fibonacci code as specified in the package doc. func (f Numbers) Decode(value uint64) (result uint64) { i := 1 for (value & 3) != 3 { + // Add the fibonacci number for the current bit if it is raised if (value & 1) == 1 { result += f.Nth(i) + + // We know that the next bit cannot be raised by Zeckendorf's theorem + value >>= 2 + i += 2 + continue } + value >>= 1 i++ } result += f.Nth(i) - 1 return }