Member-only story
Learn To Draw Your Own Lines (without canvas) — The Basic Principles Of Writing Algorithms
We often hear about algorithms, but there aren’t many tutorials that give you a sample demonstrating how to actually write one. Algorithms solve specific problems. In this case, we will draw a line on a custom raster “display” consisting of HTML elements. Of course, it is easier to simply use canvas, WebGL or some other library to draw lines. But by doing that you’re not really learning how to write your own. You will probably never have to write code to draw a line on the computer screen during your entire career as a web developer. But in this tutorial we’ll take a look at one of the most simple algorithms in computer history as an example to demonstrate the basic principles!
10 min readDec 11, 2018
Here’s a list of my best web development tutorials.
Complete CSS flex tutorial on Hashnode.
Ultimate CSS grid tutorial on Hashnode.
Higher-order functions .map, .filter & .reduce on Hashnode.