Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,707 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,275 people online right now. Registration is fast and FREE... Join Now!




shortest path source code needed for pacman game

 
Reply to this topicStart new topic

shortest path source code needed for pacman game

justgig8
5 Feb, 2007 - 05:33 AM
Post #1

New D.I.C Head
*

Joined: 5 Feb, 2007
Posts: 1


My Contributions
i need to write algo for finding shortest path for my project game. ie. pacman !
can anyone provide me tht as a c source code only?
no graphics used till yet!
the game is still in simple text mode!


Attached File(s)
Attached File  TRY1.txt ( 6.88k ) Number of downloads: 529
User is offlineProfile CardPM
+Quote Post

cdk
RE: Shortest Path Source Code Needed For Pacman Game
5 Feb, 2007 - 08:39 AM
Post #2

New D.I.C Head
*

Joined: 17 Jan, 2007
Posts: 15


My Contributions
Expand your game code by figuring out how you would solve the problem manually. It's more than just "going to the dot"; as you manually solve the problem, think of _how_ you are solving the problem -- what things are you looking for when you move the player manually in your game to go to the dot? There are lots of different ways of doing this, and right now don't worry about finding the optimum (best) way. Just find any way of moving the player to the dot. Then code that.

When you're done with that, you can modify your algorithm to find a better way of going to the dot by finding shortcuts and using more direct routes.

But first, just code a way for the player to reach the dot automatically.

Post what you've done and we can help you with the next step.
User is offlineProfile CardPM
+Quote Post

horace
RE: Shortest Path Source Code Needed For Pacman Game
5 Feb, 2007 - 01:56 PM
Post #3

D.I.C Addict
Group Icon

Joined: 25 Oct, 2006
Posts: 573



Thanked: 5 times
Dream Kudos: 50
My Contributions
QUOTE(justgig8 @ 5 Feb, 2007 - 01:33 PM) *

i need to write algo for finding shortest path for my project game. ie. pacman !
can anyone provide me tht as a c source code only?
no graphics used till yet!
the game is still in simple text mode!

have a look at
http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm
http://www.codeguru.com/cpp/cpp/algorithms...php/c5119/#more
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 04:22AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month