2

Recently I have made a simple ti-basic human vs. human connect four game with my limited knowledge of the language. It runs pretty well, and stores the occupied spaces in a list, LFILD which has a dim(length) of 42 representing each box in the 7 horizontal, 6 vertical rows of boxes. It stores 0 for empty boxes, 1 for player1(X), and 2 for player2(0). The list starts from the bottom left and goes horizontal( LFILD(8) starts the next horizontal row). Without using matrices, or having to check literally every possibility, is there fast running way/algorithm to check if someone one(that will be run every time a player puts out a piece)?

Moshe Goldberg
  • 461
  • 2
  • 15

1 Answers1

1

Matrixes vs. Lists isn't the problem here. Checking for a win in connect 4 turns out to be very difficult and slow. You can try, but on a calculator, it cannot run at a reasonable speed.

Connect 4 check for a win algorithm

Community
  • 1
  • 1
Julian Lachniet
  • 223
  • 4
  • 25