Share your repls and programming experiences

← Back to all posts
Python Turtle Maze
18cyrj (11)

The player solves a maze that is randomly generated using Kruskal's maze algorithm using python turtle

https://repl.it/@18cyrj/Finished-maze-project

Once the maze is generated you move the turtle with the dots under the maze.

Commentshotnewtop
ebest (590)

Huh.
If you randomly press buttons quickly, weird things happen.
Try.
-Ebest

ebest (590)

w a s d work. nothing else works. also, I solved the slow generation problem.
Quick now!
Takes 5 seconds to generate size 5 maze. The solution is disabling screen refreshes:
How to speed up python's 'turtle' function and stop it freezing at the end

18cyrj (11)

@laksh5: are the question marks because it's poorly done or like what's the criticism here

Brandaboss (81)

Cool! I just wish the maze was generated faster.

18cyrj (11)

@brandaboss: Thanks man! Yeah I do too, but using turtle this was the quickest I was able to get it, I bet there's more optimizing possible but I don't think it'd be much at least for this generation algorithm :)

haya (6)

not sure how to play this game 😞

18cyrj (11)

@haya: Once the maze is generated 4 circles should appear under the maze and you click on each to move in a direction. If the maze is taking a superrr long time and they aren't showing up I messed something up i guess haha

haya (6)

@18cyrj: this is what I see, I'm not sure what to do after

18cyrj (11)

@haya: If it isn't changing fairly quickly somethings broken, works on repl for me so idk why it wouldn't for others

ashtons (2)

It's a bit easy due to the small size of the maze.

edit: nvm found out I can change the grid size

thoq (4)

It doesn't work for me: ExternalError: TypeError: /\((.*)\)/.exec(...) is null on line 2

18cyrj (11)

@thoq: is that on repl? works fine for me but I just tried it in IDLE and it paused halfway through, I made this months ago but if I remember correctly it's because the turtle was inexplicably returning extremely long floats like 49.998741231245123 and I guess I forgot to make it catch that in one spot

thoq (4)

@18cyrj: Yes, on repl but I suspect that this has got something to do with our firewall. I got similar issues with other websites but only when using this network.