Questions tagged [baduk]

Baduk (also called Go or Weiqi) is a strategic board game with complete information and high computational complexity.

Baduk or Go is a board game for two players that originated in China more than 2,500 years ago. The game is noted for being rich in strategy despite its relatively simple rules.

The two players alternately place black and white playing pieces, called "stones", on the vacant intersections (called "points") of a grid of 19×19 lines (beginners often play on smaller 9×9 and 13×13 boards). The object of the game is to use one's stones to surround a larger total area of the board than the opponent. Once placed on the board, stones may not be moved, but stones are removed from the board if captured. When a game concludes, the controlled points (territory) are counted along with captured stones to determine who has more points. Games may also be won by resignation.

A Go board

Rules

Aside from the order of play rules there are essentially only two rules in Go:

  • Rule 1 (the rule of liberty) states that every stone remaining on the board must have at least one open "point", or must be part of a connected group that has at least one such open point ("liberty") next to it. Stones or groups of stones which lose their last liberty are removed from the board.
  • Rule 2 (the "ko rule") states that the stones on the board must never repeat a previous position of the whole board. Moves which would do so are forbidden, and thus at least one move must be placed elsewhere on the board (changing the board's overall position) before a player can play there again.

References

17 questions
17
votes
3 answers

Is the board game "Go" NP complete?

There are plenty of Chess AI's around, and evidently some are good enough to beat some of the world's greatest players. I've heard that many attempts have been made to write successful AI's for the board game Go, but so far nothing has been…
sharkin
  • 12,162
  • 24
  • 86
  • 122
6
votes
1 answer

Go/Baduk/Weiqi Game Board

I'm experimenting a bit with the new tag and I've already hit my first roadbump. I figured I'd start getting my feet wet by implementing a version of the classic board game Go/Baduk/Weiqi. I've drawn the xy grid using moveTo() and lineTo(), and…
5
votes
2 answers

OpenCV different approach on detecting go board

i am working on an Android app that will recognize a GO board and create a SGF file of it. i made a version that is able to detect a board and warp the perspective to make it square ( code and example image below) unfortunately it gets a bit harder…
MaMiFreak
  • 789
  • 2
  • 11
  • 26
5
votes
4 answers

WPF drawing performance with large numbers of elements

I'm trying to create a custom control in WPF to display the game tree for a game of go (see here for what it looks like). I've more-or-less got it working laying out the nodes, but one problem I've found is that it begins gets noticeably slow to…
Will Vousden
  • 32,488
  • 9
  • 84
  • 95
5
votes
2 answers

Good framework for the game of Go (weiqi, baduk)?

I enjoy the game of Go (also known as weiqi in China or baduk in Korea). I want to create a program (an evaluation function) to play it. I would prefer if the framework handled two important tasks: Handle rules for the game, including captures, ko…
Chip Uni
  • 7,454
  • 1
  • 22
  • 29
4
votes
4 answers

Algorithms to play Game of Go?

What is the state of the art of algorithms to play the game of Go ? Which articles (describing algorithms) are best to read ? There is a StackExachge site devoted to Go, but not enough people commited to ask the question there.
Łukasz Lew
  • 48,526
  • 41
  • 139
  • 208
4
votes
2 answers

Is there a good data structure that performs find, union, and de-union?

I am looking for a data structure that can support union, find, and de-union fairly efficiently (everything at least O(log n) or better) as a standard disjoint set structure doesn't support de-unioning. As a background, I am writing a Go AI with…
user1040423
  • 143
  • 8
2
votes
1 answer

Drawing stones on the board for Android Go game App

I am an Android Newbie and I'm developing Go game application for android. I'm having a problem with drawing single stone on my board. Here is my onDraw() method. public void onDraw(Canvas canvas) { //drawing a board //... //... …
Ricardo Simmus
  • 334
  • 4
  • 19
2
votes
1 answer

OpenCV detect square with difficult background

i am working on an Android app that will recognize a GO board and create a SGF file of it. i need to detect the whole board in order to warp it and to be able to find the correct lines and stones like below. (source: eightytwo.axc.nl) right now i…
MaMiFreak
  • 789
  • 2
  • 11
  • 26
2
votes
1 answer

JScrollPane viewport size

I'm trying to have hist (HistoryPanel extends JPanel) be the viewport of the JScrollPane, histScroll. The problem is that the horizontal scroll bar doesn't show up unless I force it to show up with the scrollbar policy (in the code below), and even…
1
vote
1 answer

Finding surrounded groups in 2D list

I wanted to de-rust my python abilities with a little project but I'm running into issues. For context, I'm trying to make a game of go in tkinter. I'm using a 2D list to represent the board and then displaying it. Black stones are represented as 1,…
Eeark
  • 13
  • 5
1
vote
2 answers

Fast algorithm to clear a board in Go

I am currently writing some code to deal with Go boards. A Go board is represented as an array of colors. The array has size × size entries and represents a two-dimensional square board. enum color { EMPTY, BLACK, WHITE, }; struct…
fuz
  • 88,405
  • 25
  • 200
  • 352
0
votes
0 answers

What causes an mss.exception.ScreenShotError: gdi32.GetDIBits() failed

I'm trying to write some code to use screencaptures to export the position from a online-go.server. I only got a few lines in, when I got this error from this code error c:\Go\sgo>py ogs2kgs.py top left position : 220 149 bottom right position : …
SlightlyKosumi
  • 701
  • 2
  • 8
  • 24
0
votes
0 answers

python go board game, struggling to figure out how to capture multiple stones

I've been trying to make a board game of GO, in python with pygame and a numpy array for storing the board locations and stone colors (0, 1, 2). My issue is that I've been using a for loop to examine each index at a time, and examining the adjacent…
0
votes
1 answer

Fastest Cython implementation depends on computer?

I am converting a python script to cython and optimizing it for more speed. Right now i have 2 versions, on my desktop V2 is twice as fast as V1 unfortunately on my laptop V1 is twice as fast as V2 and i am unable to find out why there is such a big…
MaMiFreak
  • 789
  • 2
  • 11
  • 26
1
2