Share your repls and programming experiences

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

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

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


Nice drawing app dude

CosmicWonderhoo (1)

can you see the broad no you cant i covered it

3DKTH3PR0 (3)

Erm, I tried it, and it DREW EVERYWHERE

tinydimond (8)

i should tell you..for me nothing happen when i touched the black near the end

ebest (672)

If you randomly press buttons quickly, weird things happen.

ebest (672)

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 (16)

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

Brandaboss (89)

Cool! I just wish the maze was generated faster.

18cyrj (16)

@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 (10)

not sure how to play this game 😞

18cyrj (16)

@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 (10)

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

18cyrj (16)

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

ashtons (3)

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

edit: nvm found out I can change the grid size

thoq (5)

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

18cyrj (16)

@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 (5)

@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.