3 ms·
Show HN: Interactive factorization diagrams
- amelius 11y agoWhy do 13 and 19 look so much different?
- sharkdp 11y agoThanks 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.
- amelius 11y agoSlightly 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?
- bjz_ 11y agoPurescript is eager - not lazy. Didn't have trouble with 123456... the key-presses did seem a tad slower though. I'm on Firefox Developer.
- sharkdp 11y agoYes, 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.
- sharkdp 11y agoI 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.
- mcnamaratw 11y agoIt'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!
- sharkdp 11y agoHuge 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!
- mcnamaratw 11y agoOhhhh, 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)
- sharkdp 11y agoExactly. Maybe a Retina display with super-resolution on the canvas would help ;-)