0

I am programming the board game Sequence in vb 2010 and I have gotten to the point where I now need to figure out if someone has won or not

Here is a link to the game Sequence and it's rules: http://www.jaxgames.com/seq.htm

I have looked at How to find the winner of a tic-tac-toe game of any size? which is similar to my problem but gets very complicated if I wanted to try and migrate the idea to Sequence.

I am wondering if anyone has any ideas on how to tell if there is a winner?

The only way I can think of is keep a list of all the possible winning positions and I would not like to do that.

Community
  • 1
  • 1
Tony
  • 56
  • 5
  • How are you representing a card and a token in memory, and how is your game board structured? We need to know that first. – Joel Coehoorn Jul 07 '11 at 20:48
  • Start by figuring out what your win conditions are, and explain them here for those of us not familiar with "Sequence". – Brad Jul 07 '11 at 20:49
  • The win condition is getting five card spaces in a row, there is a link above to the game and its rules. To answer the representation question I have a Card Class that holds the information for each individual card and for the board there is a PictureBox over each card so I know what the user clicks on. I have a player class that holds the hands of each player and was thinking about having it hold all the spots that particular player "owns" but I wasn't sure how I was going to implement winning yet so didn't add that in but that's a simple fix. – Tony Jul 07 '11 at 21:00

1 Answers1

1

You should look at the Minimax Algorithm which can be applied to determine the next move(s) in a game based on the current state. You could write your implementation such that when the computer can't determine a next possible move, the other player is declared the winner (or some other criteria, I am not familiar with the game itself).

mdm
  • 12,480
  • 5
  • 34
  • 53