Thread: c++- Please helmp me with making a "Moles and Mazes" program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    31
    Have you covered Classes in your course yet? If so, you could create a Path class which consists of Xs and Ys, and create an array which stores Path objects. You'd probably have to use a vector, though, to avoid wasting mass amounts of memory, unless you maybe only stored a single path before printing it to file. Have you learned file I/O yet? I think that would be the most sensible way to attack this problem.

    But I mean, if you were to use ONLY straight-up arrays, one for keeping track of all Xs and one for all Ys, I really have no clue how to come up with a practical solution. If you haven't covered dynamic memory, vectors, printing to file yet, you've got some serious issues to grapple with. How could you account for the fact that any one run through the maze has the potential to last an infinite (theoretically, IRL at least a large) number of turns?

    I'm thinking we're misunderstanding the specifics of the question. Could you post it exactly as your prof has it worded?

    PS: Don't forget to create a wall. You won't get through one round if you don't have a wall.
    Last edited by frog; 10-06-2010 at 06:15 PM. Reason: More info

Popular pages Recent additions subscribe to a feed