Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
C/C++ Coding challenges
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="madurax86" data-source="post: 8024587" data-attributes="member: 1293"><p>Lets do a new challenge shall we? This is just a thought; a random one!</p><p>Use your skills of programming to determine the path to take to get from point A to point B in a given maze of 0s and 1s. 1s mark walls and 0s mark paths that you can go through.</p><p></p><p>points A, B are given in (x,y) format. </p><p>The maze and points A,B will be(usually) given in a text file in the following format.</p><p>[code]</p><p>Ax,Ay,Bx,By</p><p>110111</p><p>100101</p><p>100001</p><p>100100</p><p>110111</p><p>[/code]</p><p>in this case Ax=2, Ay=4, Bx=5, By=3 (these values should be in the text file, it is shown as letters for easy readability)</p><p></p><p>The maze will be rectangular in shape and will vary in size.</p><p></p><p>About the maze.</p><p>The maze is designed in a way that the correct path is achieved by only using horizontal, vertical travel and 90 degree turning(much easier!)</p><p></p><p>Your algorithm should get the right way and it should be outputted to the screen as messages like this(like when you answer a direction question)</p><p></p><p>Go Straight n blocks</p><p>Turn Left</p><p>Turn Right</p><p></p><p>The path as a list of positions[(x,y)] is also accepted <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> </p><p></p><p>HINT: </p><p></p><p></p><p></p><p>I'm thinking of an recursive method as of now, but hey there can be better ones! </p><p></p><p>NOTE: I didn't code this yet, I won't code it today may be -- I'd only think of it today <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" /> anyways try this! These are the practical implementations of algorithms you'd need these in the future.</p><p></p><p>ANOTHER NOTE: Those who what to wonder about can make some modifications and make this algorithm a 'maze solver'--it wont need a B position, it'd be able to get out of the maze where ever it starts from <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" />(if a path exists)</p></blockquote><p></p>
[QUOTE="madurax86, post: 8024587, member: 1293"] Lets do a new challenge shall we? This is just a thought; a random one! Use your skills of programming to determine the path to take to get from point A to point B in a given maze of 0s and 1s. 1s mark walls and 0s mark paths that you can go through. points A, B are given in (x,y) format. The maze and points A,B will be(usually) given in a text file in the following format. [code] Ax,Ay,Bx,By 110111 100101 100001 100100 110111 [/code] in this case Ax=2, Ay=4, Bx=5, By=3 (these values should be in the text file, it is shown as letters for easy readability) The maze will be rectangular in shape and will vary in size. About the maze. The maze is designed in a way that the correct path is achieved by only using horizontal, vertical travel and 90 degree turning(much easier!) Your algorithm should get the right way and it should be outputted to the screen as messages like this(like when you answer a direction question) Go Straight n blocks Turn Left Turn Right The path as a list of positions[(x,y)] is also accepted :D HINT: I'm thinking of an recursive method as of now, but hey there can be better ones! NOTE: I didn't code this yet, I won't code it today may be -- I'd only think of it today :P anyways try this! These are the practical implementations of algorithms you'd need these in the future. ANOTHER NOTE: Those who what to wonder about can make some modifications and make this algorithm a 'maze solver'--it wont need a B position, it'd be able to get out of the maze where ever it starts from :P(if a path exists) [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom