I ported this algorithm to Scratch out of boredom. Change the input values to modify the line positioning. The algorithm only technically supports moving diagonally towards the bottom right.