[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is there a way to load this maze in Python and solve it (from
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 83
Thread images: 21
File: amaze.png (156 KB, 2400x2400) Image search: [Google]
amaze.png
156 KB, 2400x2400
Is there a way to load this maze in Python and solve it (from the top left to the bottom right)?
>>
Or maybe load it in paint and use a fill bucket retard
>>
>>52097983
import faggot
load "amaze.png"
>>
>>52097983

Answer is yes.

Djikstra's algorithm, depth-first-search.

http://stackoverflow.com/questions/12995434/representing-and-solving-a-maze-given-an-image

Take it from here.
>>
File: maze.png (875 KB, 2400x2400) Image search: [Google]
maze.png
875 KB, 2400x2400
>>
>>52098012
woah did you that by hand in paint bro????
>>
>>52097983
Use OpenCV with Python and implement Dijkstra's algorithm.
>>
>>52098000
unfunny because it's lowbrow humor, requiring little knowledge or intelligence to find humorous.
>>
File: Edsger_Wybe_Dijkstra.jpg (297 KB, 1024x1365) Image search: [Google]
Edsger_Wybe_Dijkstra.jpg
297 KB, 1024x1365
>>52098003
>>52098012
you are making me kind of proud

LOOK AT MY FUCKING FACE
>>
>>52097983
Didn't some anon actually take the time to solve this manually?
>>
>>52098229
only the biggest dragon dildo using, pony posting, NEETest faggot in the world would do that shit
>>
>>52098012
What algorithm does the paint bucket tool use?
>>
>>52098284
a good one.
>>
>>52098284
i believe it's called flood fill
>>
>>52098284
mouthbreathing faggot who does'nt know what a fractal is

or, a legitimate question\

so hard to tell on /g/
>>
File: 1451290381136.png (179 KB, 2400x2400) Image search: [Google]
1451290381136.png
179 KB, 2400x2400
>>52098012
can confirm.
>>
>>52098345
eat a bag of dicks
>>
>>52098012
>>52098354

I tried this with paint's fill bucket, then the window froze and not responding for a few seconds.
>>
>>52098388
took less than a second using Pinta

sure feels good to be free
>>
>>52098399
same with photoshop

sure feels good to be PROFESSIONAL :^)
>>
>>52097983
Yes. Thanks for the challenge, that's what I'll be working on tonight.

>>52098433
>bragging about expensive 5GB large software performing the same task as a free and light alternative
lol
>>
>>52098514
So you want to get into path finding basically?
>>
>>52098648
Sure, I'd like to learn more about it. I implemented Dijkstra's algorithm in a PyGame project once and that's my whole path finding experience.
>>
>>52098433
>>52098399
Same with paint.net.
>>
>>52098995
>White Pride
>>
>>52099207
I'm proud that I'm white. Does that bother you?
>>
>>52097997
Last time I tried it my paint crashed.
>>
>>52099219
No, I'm white too, brother.
It just seems infantile. If you had tits you'd probably be flashing them too like a proud woman you'd be.
>>
>>52099254
I probably would, I actually like going commando, that way my penis gets the attention it deserves. It might seem uncomfortable, but after a few days you get used to it. I even have a story behind this, but right now I don't feel like typing it out. The short version is that when I lost weight a few years ago, I noticed how my penis is actually pretty big, but it felt smaller when I was pretty overweight. Realizing this made me very confident about myself, ever since then I like showing it off whenever I get the chance.
>>
File: 1443918654864.jpg (25 KB, 400x386) Image search: [Google]
1443918654864.jpg
25 KB, 400x386
>>52098247
thanks for the keks anon
>>
>>52099350
So the white power thing is more about being comfy in your own body, than about race and politics for you? Interesting.
>>
>>52098388
>>52098399
>>52098433
works fine with Paint, maybe you guys should upgrade your toasters
>>
>>52099465
maybe you should GO FUCK YOURSELF YU PEICE OSIFT HSIT
>>
File: 1418575065407.png (384 KB, 550x424) Image search: [Google]
1418575065407.png
384 KB, 550x424
>>52099465
>spend money on hardware to make inferior paid software work better
>>
File: 1439230034303.jpg (7 KB, 250x239) Image search: [Google]
1439230034303.jpg
7 KB, 250x239
>>52099501
>>52099519
laptop using NEET retards detected
>>
>>52099534
i can solve it under <1s on my laptop.
what's your point?
>>
>>52099534
Nice frog, tard.
>>
>>52099539
nothing, just sayin that at home laptop users are faggots
>>
>>52099534
FROG POSTER = HAHAHAAHAHAHAH
>>
>>52099574
>>52099567
>>52099539
Poorfags BTFO'd
>>
>>52099571
i'm at work, what now?
>>
>>52099571
I say you are a faggot, bro.
>>
File: 1429177114622.jpg (12 KB, 258x245) Image search: [Google]
1429177114622.jpg
12 KB, 258x245
>>52099604
>>52099584
the butthurt is strong
>>
>>52099667
can you answer my question?
>>
>>52099679
Can you kill yourself?
>>
File: Untitled-1.png (277 KB, 2400x2400) Image search: [Google]
Untitled-1.png
277 KB, 2400x2400
you're supposed to go through the white part you fucking retards
>>
>>52098012
share code pls
I love these kind of things
>>
>>52099702
can you please leave, frogposter?
>>
>>52099539
Except it fills in all the dead ends, too
>>
>>52099734
i think thats the joke

the white part is supposed to make your pc shit itself, them picking the black part is a joke in response to that
>>
>>52099667
Such troll mastery. Well meme'd, my reddit friend.
>>
>>52099519
>implying free software knows how to handle resources properly
>>
>>52099823
what?

are you retarded?
>>
>>52099837
yes, he is. Just leave him alone.
>>
>>52099747
its not code. use the fill color option on Paint
>>
>>52099829
sorry bro, I don't frequent reddit. 4chan is my only home
>>
>>52099734
Coloring the maze edge shows the path from start to finish you fucking neanderthal.
>>
>>52099942
it still has the same outcome tho, whats your point?
>>
File: puzzel png.png (525 KB, 4857x4003) Image search: [Google]
puzzel png.png
525 KB, 4857x4003
solve this one
>>
File: 1dw5hlta.png (1 MB, 4857x4003) Image search: [Google]
1dw5hlta.png
1 MB, 4857x4003
>>52100073
>>
File: Untitled-1.png (2 MB, 4857x4003) Image search: [Google]
Untitled-1.png
2 MB, 4857x4003
>>52100073
not solvable.
>>
File: puzzelsolution.png (2 MB, 4857x4003) Image search: [Google]
puzzelsolution.png
2 MB, 4857x4003
>>52100116
Really original.
>>
>>52100121
nvm i just saw that green actually solved it.
>>
>>52100132
It's still a great maze that will fool most bucket users.

One of the nicest looking paths I've ever encountered while generating mazes
>>
File: christmas_puzzle.png (188 KB, 2400x2400) Image search: [Google]
christmas_puzzle.png
188 KB, 2400x2400
Some anon did indeed solve this by hand.
>>
>>52100643
nice
>>
>>52097997
Caused a BSOD, thank you
>>
File: 1451290381136.png (159 KB, 2400x2400) Image search: [Google]
1451290381136.png
159 KB, 2400x2400
>>52097983
>>52097997
Doesnt work
>>
>>52100122
Longest possible non-intersecting solution?
>>
>>52099405
Frogposter please go away
>>
File: 1425899298159.jpg (41 KB, 409x409) Image search: [Google]
1425899298159.jpg
41 KB, 409x409
>>52101866
ok kid
>>
File: 1451290381136_solved.png (593 KB, 2400x2400) Image search: [Google]
1451290381136_solved.png
593 KB, 2400x2400
>>52097983
I've made a solution in c# not so long ago, it was fun.
>>
>>52098012
>>52098354
>>52099465
How the hell does this solve it, you idiots.
>>
>>52104842
How about using your brain?
>>
>>52097983
Just stick to the left wall :^]
>>
File: mazesolver.jpg (71 KB, 979x514) Image search: [Google]
mazesolver.jpg
71 KB, 979x514
>>52104665
I made two kind of solutions:

First works as bucket fill, it creates a 2d int array the same size as the image, then from startpoint it starts to fill the distance data into the array, when it hits the endpoint, it starts to draw a line into the direction where the value is exacly 1 less than itself.
Pros:
-shortest path found
-very easy to code
Cons:
-probably the slowest of all solutions


The second works like
>>52098012
and
>>52098354
It fills one side of the wall, then it follows the path between the two colors.

Pros:
-Fast
Cons:
-If there are multiple paths, it won't find the shortest, it just finds one
-If the walls aren't prepainted, it might be just as slow as #1 solution.


There is a third solution I know of but I didn't even considered coding it.
You just stick and follow one of the walls, eventually you get to the end.

Pros:
-Easiest to code
-This is the only solution of the three that doesn't use meta data, this one really solves a maze without "cheating"
Cons:
-Slow
-unnecessarily long path.

>>52104842
The solution is between the two colors obviously, as the entrante and end has to cut the maze into two.
>>
File: Capture.png (920 KB, 1692x1022) Image search: [Google]
Capture.png
920 KB, 1692x1022
>>52098012
Took less than a fucking second in Photoshop, holy shit, but it used half a gb ram
>>
>>52107202
Why aren't you filling the empty space instead of the "walls"?
>>
>>52107386
try it and find out
>>
>>52107386
Damn, you dense!
>>
>>52099429
Well, I guess.
>>
File: maze.png (91 KB, 2400x2400) Image search: [Google]
maze.png
91 KB, 2400x2400
not perfect but you can use photoshop to generate a line, just blur the two differently colored sections together with difference color mode.
>>
>>52100643
nice autism
Thread replies: 83
Thread images: 21

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.