Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Need help on a Minesweeper project

I'm responsible for making a text based minesweeper program as my final project in my C++ class. The instructions are as follows.

"Create a text version of the mine sweeper program. You will need to use a class for the player with name and high scores. Use methods to do the processing of the moves. You should be utilizing all the concepts you learned this semester in C++. Classes, arrays, input/output, loops, if statements, switches, etc. For a bonus 10 points high scores should be saved in a file and read back in each time the program is run."

I understand some of the basics that I need to do, such as setting up the grid, as well as assembling the player class. What I do not understand is how to setup the methods or functions that decide what happens when a move is made. I don't understand how I would go about making moves, etc. This seems like a very advanced project for an introductory programming class but maybe I am over thinking it. If anybody knows of online examples, or can help me here, I would greatly appreciate it.
Help you. Help means to put in work to accomplish a cause together, and in order to do that, you must already know what you are doing and be doing work as well. What you said is you don't understand what to do when a move is made. You check whether that slot on the grid contains a mine, if it does, they lose. If it doesn't, then you check the slots adjacent to it and find out the number of those slots have mines, then replace the slot they chose with that number. If there are none, then clear all those slots as well and do your mine checking for all of those slots, and so on and so forth. (Hint: Recursion)
We never really went over recursion. Do you know of any good resources that would help me in understanding recursion? I'll be searching away. Thanks for your help.

False alarm, I didn't realize what recursion actually was. Looks like I can go about starting this now. Thanks.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by AurianaJul 5, 2018 06:29 PM 0 194 Jul 5, 2018 06:29 PM
Last Post: Auriana
[Shell] by White LightJan 2, 2015 12:04 AM 9 384 Jan 2, 2015 12:04 AM
Last Post: Chaffmiester
[C] by shaggy756Apr 27, 2014 12:41 AM 9 169 Apr 27, 2014 12:41 AM
Last Post: 0xDEAD10CC