Skip to content

An OpenAI Gym implementation of the famous Connect 4 environment

License

Notifications You must be signed in to change notification settings

Danielhp95/gym-connect4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drawing

Connect 4

Connect 4 is a two player, zero-sum, symetrical connection game, in which players take turns dropping one coloured disc from the top into a seven-column, six-row grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical or diagonal line of four of one's own discs.

Fun fact: Connect 4 is a solved game. The first player is guaranteed to win by playing the right moves.

Game parameterization

The gym environment takes the following parameters:

  • Width: Number of rows on the board. Default: 7
  • Height: Height of each board row. Default: 6
  • Connect: Number of chips of the same colour that need to be placed in a valid pattern to win the game. Default: 4

Use gym.make to pass a specific parameterization. For instance: gym.make('Connect4-v0', height=6, width=9, connect=2)

About

An OpenAI Gym implementation of the famous Connect 4 environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages