10 comments

[ 3.3 ms ] story [ 30.8 ms ] thread
Why do 13 and 19 look so much different?
Thanks for the feedback. Apart from the background color, they look the same (polygons with 13 or 19 vertices). The color is different because only small prime factors (≤ 13) have a dedicated color. But that's something that I can certainly improve.
Slightly offtopic: if I type "123456" the UI becomes unresponsive (cannot type backspace for instance). It may be that the language Purescript is "lazy", but somehow this does not seem to work out for the user. Any comments?
Purescript is eager - not lazy. Didn't have trouble with 123456... the key-presses did seem a tad slower though. I'm on Firefox Developer.
Yes, thanks for clarifying: Purescript is eager. But the slow response time is not related to Purescript being eager or lazy, it's related to the slow prime factorization algorithm.
I added a hard limit of 10,000 (in the input field and the code), because the prime factorization will be too slow otherwise. Maybe your browser takes a long time to draw the diagram for 10,000 and that is why the UI becomes unresponsive.
It's awesome. That's really nice.

One thing, when I pick a number with an annoyingly large prime factor (e.g. 1655=5*331), it seems to drop the large factor. At some point that probably makes as much sense as drawing 331 pentagons. But does it indicate somewhere that a factor isn't displayed?

EDIT: Ohhh, the dots are just very small. Thanks for the explanation!

Huge prime factors are indeed a problem (in the sense that the simply look like circles). I think I can work a little bit on the scaling of the diagrams (there is still some free space). Maybe this would help to see larger prime factors. Thanks for the feedback!
Ohhhh, so when I do 1655 I'm not just getting a pentagon, I'm getting five circles, each made out of 311 little tiny dots? (Or however many dots it is :P)
Exactly. Maybe a Retina display with super-resolution on the canvas would help ;-)