2 ms·
I rewrote it in C, so it's faster and can work more efficiently on different data sets. It also uses a prettier algorithm for determining heights. Have fun: ht
by zx2c4 15y ago
I rewrote it in C, so it's faster and can work more efficiently on different data sets. It also uses a prettier algorithm for determining heights. Have fun:
http://git.zx2c4.com/spark/tree/spark.c http://git.zx2c4.com/spark/tree/spark.c
$ git clone http://git.zx2c4.com/spark
$ cd spark
$ make
$ ./spark 1 4 2 8 14
▂▃▂▅█
$ curl -s http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt | cut -d, -f9 | ./spark
▂▃▄▃▃▃▄▃▇▃▄▄▄▅▃▄▄▄▅▅▅▄▄▄▃▃▃▃▃▄▃▄█▅▄▄▄▄▃▇▄▄▄█▄▃▄▄▄▄▃▃▄▅▄▅▃▃▃▃▇▄▅▄▇▃▅▃▄▃▄▃▇▃▃▄▇▃▄▃▄▃▃▃▄▃▃▃▃▃▃▅▃▄▃▃