holman/spark — pull request #42 by markusfisch (2011-11-16 15:30:18+00:00)
Title: Respark

Hi,

I just stumbled over spark and couldn't get on without forking it. Such a
very cool idea!

But since I did a lot of shell programming lately, I would solve the problem
in a different manner. Have a look at it if you have the time. That way it's a
lot faster and a little more compact.

Of course, if you don't like my approach, I'm fine with it. In that case, I
hope you'll see my rewrite as homage ;)

Now, while trying to verify my output against yours, I've come to notice
a few things:

* numbers that are all lower than the total number of ticks display their
value instead of the relative difference between them:

spark 2,4,5 => ▂▄▅

Should read:

spark 2,4,5 => ▂▄█

Here, the 2

spark 2,4,8 => ▂▄▆

should be ▁ (not ▂) as it is the lowest number.

* this applies also to higher numbers, for example, I would expect the
same result for those two data sets:

spark 11,22,33,44,55,66,77,88 => ▁▂▃▄▅▆▇█
spark 22,33,44,55,66,77,88,99 => ▂▃▄▅▆▇██

At least for my understanding, this isn't quite right so my implementation
doesn't produce the same output (for that cases) as yours.

Kind regards,
Markus