How to store info, while writing a certain game

  • Thread starter Thread starter Head_one
  • Start date Start date
H

Head_one

Guest


Long introduction but short question.

Longtime ago I have encountered a nice computer game, in which a user plays against the computer.

The attached picture shows the game. A matrix of random numbers are displayed in a square.

The aim of the game is to collect more points than the opponent (computer)

Attached a picture of the maxtrix 6X6 squares. The letters are the rows’ and columns’ names.

Collocting points is done by selecting a square. The written number is addded to your account.

The human start the game, and selects 9, from row a.

He chosses 9, because it is the largest number. The 9 disappears from the game.

Now it is computer to go.

The rule is that the computer must select a number, only from the “touched” column,

It means, from Column d. He chooses number 8, from row b, and this number disappears.

Now the user must select a number from row b, and will probably select 7 from column f.

The rule is: Users may select only from horizontal rows.

Computer may select only from vertical columns.

The winner is the one with greatest number of points.

A good player must think a few steps further, because selecting the greatest number in current

turn, does not mean, it is the best decision.



Now the question. I want to write this game in vb.net.

The graphics is not a problem

Disabling all squares but enabling a certain row to select from – no problem.

Hiding numbers and disabling their squares – no problem



My problem is how to store the info for the computer, in order to choose

The best move from, let’s say, 3 steps ahead.(Clever enogh)

I do not think that arrays, list, constructs etc can help here.

So, how can I do it?

Thanks to all helpers. Moshe.




All things are difficult before they are easy. (unknown)

Continue reading...
 
Back
Top