Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maze Challenge
#1
This is a quick challenege. It's just intended to give people something to do. The challenge will only last 1 week from the date of this post (i.e. next monday).

DO NOT PUT CODE IN THIS THREAD OR YOU'LL BE GIVING IT AWAY
POST COMPLETED PROGRAM HERE: http://qbtk.com/phpBB2/posting.php?mode=reply&t=608 (Use the add attachment feature to add it to the post you make. If you need help, go to www.qbtk.com and private message Myself, Zap, or Rhican as to how to do it). No one but the admins will be able to see it.

In this challenge you will nagivate your way through a rectangular maze. The maze is a 10 by 10 grid of cells where each cell is iether a 1 (representing a wall that you can't go through) or a 0 (representing a passage way that you can go through). There are two cells on the boundary of the grid which will be marked 2 (representing the entrance into the maze) and 3 (representing the exit out of the maze). Note that the boundary will be all 1's except for the entrancec number 2 and the exit number 3.

Your program should identify the locations of the entrance and the exit and display the "path" from the entrance to the exit. The path should be a string of characters made up of the letters N, E, W, S (in upper case) denoting North, East, West, and South repectively. Note that there will be exactly one path from the entrance to the exit represented by the sequence of 0's between 2 (the entrance) and 3 (the exit).


Example Maze:

Code:
1111111111
1110000002
1110111111
1110011111
1111011111
1000011111
1011111111
1011111111
1000011111
1111311111

The output for the program should read: WWWWWWSSESSWWWSSSEEES



Input for the program will consist of 10 lines of data each line containing a string of 10 characters made up of 0's and 1's except for the single 2 (entrance to the maze) and the single 3 (exit) on the boundary.


Sample input data for Qbasic
Code:
DATA 1111111111
DATA 1110000002
DATA 1110111111
DATA 1110011111
DATA 1111011111
DATA 1000011111
DATA 1011111111
DATA 1011111111
DATA 1000011111
DATA 1111311111

Corresponding output:
WWWWWWSSESSWWWSSSEEES


Now that we've gone through official stuff, here's other important things you need to know. The competition ends one week from the date of this post. What you have to do is submit your code work to the link that was given at the top of this post. Whenever an admin notices your post, they will check it against their data. If your program works, then you will receive a pm saying "Your program works", if it doesn't, you will receive one saying "It doesn't work".

There will be three winners for this competition. They will be the first three to submit their working answers. The winners will not be notified or announced until the competition is over with. This means that you should not give up because you think you aren't quick enough! This also means you may want to hurry because you never know how many have submitted and are ahead of you.

REMEMBER THIS PROGRAM NEEDS TO BE FLEXIBLE ENOUGH TO HANDLE ANY 10 x 10 MAZE THAT HAS A START AND AN END!!! DO NOT JUST MAKE THIS HARD CODED FOR THE SAMPLE DATA
url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Reply
#2
Hmm, wasn't there a pathfinding challenge recently as well?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
I'm in, code uploaded, it should work, but I'm to tired to do any serious bugtesting...

...Hardcoded for sample data that would be, for example
"PRINT "WWWWWWSSESSWWWSSSEEES"" eh? ^_^
/post]
Reply
#4
Quote:...Hardcoded for sample data that would be, for example
"PRINT "WWWWWWSSESSWWWSSSEEES"" eh? ^_^

I figured if I didn't say it, someone may.

@Zack: Probably, I just think this is a fun and easy challenge. It was one of the challenges from the programming competition I was in and we finished it in under 20 minutes, so it's terribly simple. I just was giving people something to do.
url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Reply
#5
Well for this quick compo we had only two winners. Here's how the scores ended up.

1st. red_Marvin
2nd. Plasma


Thanks also goes out to Python167 who entered but didn't quite understand the rules and made a game.
url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Reply
#6
woohoo
Reply
#7
I'm going to get a cookie!
/post]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)