Click the green flag to start. Press any key to change the level. You will see the shortest path between the dots. You can see inside to make sure I'm not pre-setting the values for right and left.
I made this completely on my own after my dad told me what the Dijkstra algorithm does. I didn't use the Dijkstra algorithm here though. the Dijkstra algorithm finds the shortest path between 2 points. Explanation of Dijkstra algorithm: https://www.youtube.com/watch?v=EFg3u_E6eHU shout out to @mydad (he doesn't have a scratch account)