![]() |
|
[C] Need help on a Minesweeper project - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] Need help on a Minesweeper project (/showthread.php?tid=4187989) |
Need help on a Minesweeper project - shaggy756 - Apr 22, 2014 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. * - Mouse❤️ - Apr 22, 2014 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) * - shaggy756 - Apr 23, 2014 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. |