/wpc/ - Weekly Programming Challenge 4

Previous Thread This week: Maze Generation and Solving

This week's challenge is a two part challenge focused on building and solving mazes.

- Create a program that produces a black and white image of a maze with a single start and finish area. Black pixels should denote maze walls and white pixels should denote paths. The maze building program should be able to build mazes in a variety of ways and produce an output that has multiple solutions, i.e. an imperfect maze.

- For the second part, given a black and white image of a maze with the same rules as above, create a program that solves the maze. The maze solving program should be able to take the input maze that contains multiple solutions and find the shortest path through the maze.

- The final task is to visualize both the creation and solving process in some manner.

>How to / FAQ
paste.pound-python.org/show/t4J8QD8ncBcYznIxulWL/

>Previous Challenges
Week 1 (Draw a picture using random shapes)
Week 2 (Conway's Game of Life)
Week 3 (Color Quantization)

Other urls found in this thread:

github.com/xxbtwxx/HyperSnakes/blob/master/snake.cpp
cr31.co.uk/stagecast/wang/perfect.html
ceur-ws.org/Vol-1543/p9.pdf
cr31.co.uk/stagecast/wang/imperfect.html
pastebin.com/KSBh56GZ
twitter.com/SFWRedditGifs

Love you

How sweet

significantly more people posted their actual code in solutions 1 and 2 than for 3.

people can absorb a lot out of reading a different approach to a problem. strongly recommend posting code :-)

>Create a program that produces a black and white image of a maze with a single start and finish area.
>The maze building program should be able to build mazes in a variety of ways and produce an output that has multiple solutions
Instructions unclear, dick caught in ceiling fan.

Part one seems interesting. Part two is just trivial.
Also write your own homework :^)

What actually telling people how to index lists, instead of giving them fucking pointless chalanges so they cannot use both brain and computer at once?

pajeet go

haha good meme my reddit bro :)

>Part two is just trivial.
Implementing A star is a great exercise, far from trivial. Improving your implementation for best performance with solving mazes can be a proper challenge.

A-are you ok

A* is just Dijkstra with added heuristic cost function

Go implement djikstra from scratch. It's a great challenge

Wanted some way to point out this flaw without sounding like a huge dick. Figured this was the best way.

Been there, done that
github.com/xxbtwxx/HyperSnakes/blob/master/snake.cpp

Line 188

Hey, user, I'm not saying it's undoable. I'm saying it's a great exercise, far from trivial.

Those threads are meant to be not fully clear, to let people come up with more different solutions. It's a feature, not a flaw.

I am not saying it's a bad exercise. But it is high school tier algorithm (at least here in Bulgaria)

Not fully clear != contradictory
It's literally impossible to make the program in the OP.

I don't think you're understanding this properly. Even with one entry and one exit there can be multiple solutions.

Thats a bad way to do it. Try again

Djikstra is fun, but too easy.

Ant colony algorithms and simmulated annealing is where the fun begins. Because you have actual parameters where you either do a lot of trial&error or (and of course you want this!) you write another meta programm that tries your algorithms with differnt parameters, evaluates the results and gives you an overview about the quality of parameters.

The cool thing is, you can start easy but you can add a lot of details like numerical stuff or even AI stuff - if you want to and get bored.

Guess I did, I thought an imperfect maze meant multiple exits. It being imperfect because it doesn't fit the description. Apparently this is the definition.
cr31.co.uk/stagecast/wang/perfect.html
My bad. OP seems to be right then.

why are all of these related to image manipulation/reading

You can do maze solving and game of life in the terminal.

>ant colony
>single solution maze

Maybe because this is a fucking imageboard?

Its a fucking array

Didnt even need to read your post to know that youre an idiot

What's your point?

>ceur-ws.org/Vol-1543/p9.pdf

I did post my 1 and 3 solutions in python.
In fact I left unused commented shit that I tried and did not work for all to see. No 2 I have asses the attempt so no code from me.
I also encourage other to post code so that anyone can learn from it.
This week I won't be able to work on this given the civil war we are about to experience here.

What civil war.

catalonia, eh?
ganbarou!

No, that's not it at all, the word perfect was never even used.

>i.e. an imperfect maze.
?

So a perfect maze is a maze that only has one solution, while an imperfect maze is one that has multiple solutions, so basically places where the maze loops.

cr31.co.uk/stagecast/wang/imperfect.html

if this thread dies post a different challenge because this one sucks

:(

i dont see anything wrong with it. ill probably jump into it tomorrow

Maze generation just takes a while to tackle, I suggest that those who're trying to solve the puzzle write and post some of the code they have so far, and pictures etc.

V0.1

I really need to try some of these challenges some time.
I've saved all the threads for later reading.
Will be busy tomorrow though.

Bump for interest.

why are all of these image challenges

#2 and this are not image challenges

yeah okay man,............

I had already made a maze generator a couple of months ago, here it is

you alright bud

Okay, I can make a maze and then solve it. Drawing looks like ass but I think I can tolerate it. I did a straightforward graph method. I start with a singleton graph for each square and then randomly connect them. Creating the maze is complete once there is only once graph left. Then you do a simple depth-first search for the exit node, keeping track of the path as you go. It works but I feel like the output isn't very 'good.' There are far too many paths that immediately dead-end and looks too sporadic. Going with a less random method would probably work better.

Maybe it's because we're on an image board you fucking faggot.

Here's a silly gif. Not sure if I'll bother improving this any.

>lets not make useful programs, lets do dumb shit that is basically a glorified "hello world" and then attention whore by showing everyone xDDDD
unilaterally kill yourself

t. shitter who cant program

t. mister redditor who only makes meme programs

This is a challenge thread for the average Sup Forums shitlord to do in a few minutes. They're not going to ask for a business standard algorithm.

its a thread for people to waste time
they should be working on REAL problems and making REAL stuff
but they can't, they are sheep and can only follow orders, so they must be force fed a task, some busy work, its pathetic

...

Show me some of your non-meme programs, I'd love to see them.

>please increase your attack surface so i can attack you by nit picking, because nothing you post will be acceptable in my eyes XDDD
>ALREADY MADE UP MY MIND ABOUT YOU BRO XDD
pic related my man

>Butthurt people aren't doing work in their free time
>calls them sheep who need to be force fed busy work
Thinking_emoji

And it's not busy work, it's a fun little puzzle to do which gives a nice little graphical toy at the end. There's much worse ways to spend time.

>it's not busy work

???
Are math puzzles busy work?
These things aren't that labor intensive.

its strange that this thread would bother you over the the ad infinitum cellphone/distro/rice threads

would love to see your github though bud! im sure you're full of contributions :-)

Please stop falling for "I was just pretending to be retarded" tier shitposting and ruining the thread.

busy work is literally simple shit for you to do to make you feel as if you're working, that you're progressing, its a tactic to help depression
but instead you should do real shit that you've decided to do on your own
period

see

>discussion i don't like is shitposting/trolls/shills

What is this magical "real shit" which is neither "busy work" nor work?

you sit down, think of something cool and USEFUL, and try to make it
this shit here, its not useful, and you're just following orders like a cuck, its busy work

yikes at being this starved for attention

lol at your life being shit

Sure, I agree with you.
But this is for people who aren't very good in language x and want to find a variety of small things to do to test their proficiency.
I completely agree with you that there are far more "useful" things that you could do.

Following a script to learn how to do basics doesn't make you a sheep.

>random projection

relax fun has value

>Following a script to learn how to do basics doesn't make you a sheep.
no you get an idea, start to do the job, google for ANSWERS
but never ever just follow some fucking guide from step 1 to 10
and never let someone else think for you

what i described is also fun, if you truly like what you're doing, simpleton

lol

Not what I meant.
These challenges are like questions in a math textbook to help you learn algebra.
Sure, go off and invent a new branch of mathematics, but you aren't doing any harm by going through the exercises.

Okay, I'll start by disregarding everything you've said.

>any harm
its literally drone memorization of a step by step spoonfed shit sauce, just hush
brainlet lets be honest you can"t even comprehend what i said

...

The fuck? You're saying basic math is a "shit sauce"?
Now I know you're just trolling.
Go back to /lit/

>literally drone memorization of a step by step spoonfed shit sauce
Can you get this itty bitty concept through your thick skull? This is an open challenge to test your understanding. It's not a step-by-step coding tutorial, nor is it a day-long project to give sheeple work over the weekend.
>just hush
learn to speak properly you autistic prick. I can already tell you're intolerable to work with.

yeah idk, this is boring now, enjoy your busy work plebs lol

Just want OP to know that I appreciate his threads and gave a good goal to work towards while teaching myself Haskell.

These programming challenges are useful for people who are currently learning a language, since they are more complex than the average exercise, but don't necessarily involve that much time or require that much knowledge. They also have a chance to expose people to new areas of programming, like image processing and such, so at the very least people will get the knowledge to use some png library in their language of choice out of them. Besides, it's not like there are that many useful programs you can write, I mean chances are some other people already made a program that does the thing you want it to do, but is much better than anything you could ever hope to write by yourself. And in case you have a truly novel idea no-one has thought of before, then you don't make it a programming challenge, but create the software yourself and rake in the money instead.

If you act like this über-productive person who only ever wrote useful programs in his life while simultaneously wasting your time shitting on people who are actually doing something right now, then be prepared to be called out on your bullshit.
Just name one useful thing you ever wrote.

post your source code faggotssss

>i need it to finish my homework guis

whatever man, im done talking to you faggots, and i dont appreciate the mod going through 50 of my old posts just to find some dumb shit to warn me from
you can go fuck yourself butthurt mod

Here's a new challenge: create a maze with no connecting walls that would still pose a challenge to the typical player.

I would if I wasn't embarrassed by how bad it is.

>P O S T
>I T

Fine, but it's pretty rough and I just copied a class I used awhile back and used it for the merging cells part.

pastebin.com/KSBh56GZ (C++)

Enjoy.

seems pretty clean to me.
Then again, i don't know C++ and i'm new to programming so only blatantly shitty code will make me sick.