Qbasicnews.com
January 17, 2020, 06:04:06 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Maze Challenge  (Read 6508 times)
Sumo Jo
Been there, done that
*****
Posts: 1244



WWW
« on: June 21, 2004, 03:11:51 PM »

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
Logged

url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Zack
*/-\*
*****
Posts: 3974



WWW
« Reply #1 on: June 21, 2004, 05:36:00 PM »

Hmm, wasn't there a pathfinding challenge recently as well?
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #2 on: June 21, 2004, 08:47:00 PM »

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? ^_^
Logged

/post]
Sumo Jo
Been there, done that
*****
Posts: 1244



WWW
« Reply #3 on: June 21, 2004, 10:51:39 PM »

Quote from: "red_Marvin"

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

url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Sumo Jo
Been there, done that
*****
Posts: 1244



WWW
« Reply #4 on: June 29, 2004, 11:46:57 AM »

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

url=http://fileanchor.com]FileAnchor[/url] - ImageAnchor - FBTK - QbasicNews - VPlanet - Various
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #5 on: June 29, 2004, 12:40:02 PM »

woohoo
Logged
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #6 on: June 30, 2004, 04:23:54 PM »

I'm going to get a cookie!
Logged

/post]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!