CPU Player VB.NET

121 views Asked by At

So I'm developing a minesweeper flags game and the multiplayer version is all set up, but the single player version is still under developement. It's important to refer that I'm using a DataGridView, and I'm applying r = tab1.CurrentCell.RowIndex + 1 and c = tab1.CurrentCell.ColumnIndex + 1 to see where the player clicks. What I want to do is to make the AI click any random cell when it's turn comes, but how do I do this. Any thoughts?

Best regards, joao.

1

There are 1 answers

0
AvkashChauhan On BEST ANSWER

Have you looked at this article: Creating an Artificial Intelligence to play Minesweeper

In this article there is a discussion of using information Array, hypothetical array and hidden array as below:

  • Let us call the array holding the information our AI possesses the information array, and the array holding hypothetical situations the hypothetical array. The array storing the positions of mines is, of course, not immediately accessible to our program... we'll call that the hidden array.

You might need to do as below:

  1. Have an information array which has info about your mines using the Layout
  2. Have an array which provides the location about player selection
  3. Based on 1) and 2) select a position to choose