Skip to content

OpenAI Gym Env for game Gomoku(Five-In-a-Row, 五子棋, 五目並べ, omok, Gobang,...)

License

Notifications You must be signed in to change notification settings

vencia/gym-gomoku

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gym Gomoku Environment(Five-In-a-Row)

OpenAI Gym Env for game Gomoku(Five-In-a-Row, 五子棋, 五目並べ, omok, Gobang,...) The game is played on a typical 19x19 or 15x15 go board. Black plays first and players alternate in placing a stone of their color on an empty intersection. The winner is the first player to get an unbroken row of five stones horizontally, vertically, or diagonally.

#Demo gym_gomoku_demo

Installation

Pip

pip install gym-gomoku

Github

git clone https://github.com/rockingdingo/gym-gomoku.git
cd gym-gomoku
pip install -e .

Quick example

import gym
import gym_gomoku
env = gym.make('Gomoku19x19-v0') # default 'beginner' level opponent policy

env.reset()
env.render()
env.step(15) # place a single stone, black color first

# play a game
env.reset()
for _ in range(20):
    action = env.action_space.sample() # sample without replacement
    observation, reward, done, info = env.step(action)
    env.render()
    if done:
        print ("Game is Over")
        break

About

OpenAI Gym Env for game Gomoku(Five-In-a-Row, 五子棋, 五目並べ, omok, Gobang,...)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%