If you have a [num-lock] numeric keypad: use 8/2/4/6 to go up/down/left right (normally, they're the arrow keys), and 7/9/1/3 for up-left/up-right/down-left/down-right: 789 4 6 123 Alternative keys for a small [notepad] keyboard: Use the arrow keys to move left/right/up/down. To move diagonally, use the Q/W/A/S keys: Q ^ W < > A v S When you get the mouse to the cheese, you "win" a harder maze.
Cheese image by Glitch: https://openclipart.org/detail/209541/food-cheese-very-stinky The algorithm is explained at https://scratch.mit.edu/projects/97085616/ The only difference is that the values at the "walls" list are 1 - a wall to the right 2 - a wall at the bottom 4 - a wall at the top-right corner 8 - a wall at rhe bottom-right corner If a cell has several walls, we add up these values. To test whether value v is part of the sum w, we check if mod(floor(w/v),2)=1. For example: mod(floor(14/4),2)=1, so if our cell's "walls" value is 14, it has a top-right wall. When we draw the maze: * We don't draw the diagonal walls near the edges. Instead, we let the right/bottom wall go all the way to the edge. * If we draw a diagonal wall, and there's a cell on the other side of that wall, we also draw a wall at the opposite corner of that cell (to complete a diagonal path or a diamond-shaped barrier). Note: the maze is not supposed to contain loops [unless there's a bug ;)]. Sometimes there are disconnected "islands" (and this drove me nuts for a while), but you can't really go around them and get back to the cell you came from.