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
    Dec 2009
    Posts
    120
    Quote Originally Posted by IKnew View Post
    Oh I re-read your post and I get it... ya.. did you learn ofstream yet?
    No, were basically supposed to do this with some if's and some arrays.

  2. #2
    Registered User
    Join Date
    Sep 2010
    Posts
    33
    Why not start off with a simplified version, whereby the number of moves per game is restricted to say 100, else failed attempt. Then you can easily get started with one-dimensional arrays.

    Create your main loop zero to 499.
    Initialize arrays to zero.
    Start position row[0] = 3, col[0] = 2.
    Create an inner loop one to 99.
    Test direction.
    Move accordingly, col[j] = col[j-1] + 1;
    Test for boundary.
    Test for successful attempt.
    Print out number of failed attempts and successful sequence.

Popular pages Recent additions subscribe to a feed