Hello, I am trying to code a MineSweeper in C++. My question is, say that I want to use Double Dim arrays, how would I actually generate random mines, and how would I make it so they have to choose between numbers, say 1 to 100 in a 10 x 10 grid? Thank you. Any help would be greatly appreciated.
MineSweeper in C++?
%26gt;%26gt; how would I actually generate random mines
Use some algorithm to populate the array with mines. There's various ways to create a random distribution, and you can either create something simplistic or Google for various mathematical descriptions of distributions and random generators.
%26gt;%26gt; how would I make it so they have to choose between numbers, say 1 to 100 in a 10 x 10 grid?
Ask them, then take in an integer as an input.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment