One thing I’m playing with, as I explore the many things a PB can do, is try different ways to do the same thing…
For example, drawing a line.
(Yes, yes, this means having a canvas, which itself can be done different ways)
I just implemented a version of this algo: https://jsfiddle.net/6x7t4q1o/5
It draws a continuous line (so it doesn’t do diagonal movement), from point A to point B.
Compare that to the Xiaolin Wu algorithm that @sorceror did. Different approach, similar but different. Pros and Cons to each.
Doing the Randogram pattern I just added, which implements 6 different algos for random, and really could do many more, some of which are different enough to warrant using in particular use cases, some of which aren’t worth using, and some of which are ‘good enough for most cases’ (built in random for example), makes me realize that part of making a good library of libraries, and even a set of tutorials that build up skills, is that you need to have a good firm ‘best practice’, but then again, the best practice might just be another way to do it… and the best way to figure out the best practice is implement a handful of ways and see what works well and is fast/easy/cheap (or whatever the 3 legged tripod is in the case of code)
I’ll likely do a pile of these ‘same thing done multiple ways’ patterns, just to flesh out my learning, and hopefully others will find them helpful.