Skip to content

Instantly share code, notes, and snippets.



Last active Jul 21, 2020
What would you like to do?
Game of Go
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook MIT License, Copyright (C) Ken Webb, Tue Jul 21 2020 14:05:58 GMT-0400 (Eastern Daylight Time)-->
Title: Game of Go
InternalName: 6d01bf84182d790658f5034ef7768608
My Notes
July 21, 2020
The traditional game of Go, played on a board.
files from GO, by Ishmael [ref 6]
Y board.png
n flag-black.png
n flag-white.png
Y index.html
Y ish.go.js
Y ish.go.logic.js
Y ish.go.view.h5.js
n ish.go.view.text.js
? jquery-1.6.1.min.js
n lite.html
Y piece-black.png
Y piece-white.png
Y rules.txt
Y style-h5.css
n style-txt.css
n tests.txt
n touch
n touch-info.txt
JS libraries
Go is an abstract strategy board game for two players, in which the aim is to surround more territory than the opponent.
The game was invented in China more than 2,500 years ago and is believed to be the oldest board game continuously played to the present day.
A 2016 survey by the International Go Federation's 75 member nations found that there are over 46 million people worldwide who know how to play Go and over 20 million current players,
the majority of whom live in East Asia.
The playing pieces are called stones. One player uses the white stones and the other, black.
The players take turns placing the stones on the vacant intersections ("points") of a board.
Once placed on the board, stones may not be moved, but stones are removed from the board if the stone (or group of stones) is surrounded by opposing stones on all orthogonally-adjacent points,
in which case the stone is "captured".
The game proceeds until neither player wishes to make another move.
When a game concludes, the winner is determined by counting each player's surrounded territory along with captured stones and komi
(points added to the score of the player with the white stones as compensation for playing second).
Games may also be terminated by resignation.
The standard Go board has a 19×19 grid of lines, containing 361 points.
Beginners often play on smaller 9×9 and 13×13 boards, and archaeological evidence shows that the game was played in earlier centuries on a board with a 17×17 grid.
However, boards with a 19×19 grid had become standard by the time the game reached Korea in the 5th century CE and later Japan in the 7th century CE.
Go was considered one of the four essential arts of the cultured aristocratic Chinese scholars in antiquity.
The earliest written reference to the game is generally recognized as the historical annal Zuo Zhuan (c. 4th century BC).
Despite its relatively simple rules, Go is very complex.
Compared to chess, Go has both a larger board with more scope for play and longer games, and, on average, many more alternatives to consider per move.
The number of legal board positions in Go has been calculated to be approximately 2 × 10170,
which is vastly greater than the number of atoms in the known, observable universe, estimated to be about 10
Video Tutorial for the Game of Go - Part I, Overview (WeiQi, Baduk)
(6) this works
) file:///home/ken/JavascriptThirdParty/AAAgo/Go-gh-pages/index.html this works
GO, by Ishmael
I will try to implement "GO, by Ishmael" in this Xholon workbook.
This project is a simple browser based implementation of the classic board game, Go, using HTML5 and JavaScript.
Only game logic and some debugging tools were developed, which means pre- and post-game state handling isn't included.
HTML5 Version
MIT License
the code is 9 years old
the game automatically:
- starts with black
- switches between black and white
- removes stones that are surrounded
<!-- domain objects -->
<!-- quantities -->
<Height superClass="Quantity"/>
<port name="height" connector="Height"/>
<Height>0.1 m</Height>
<Brick multiplicity="2"/>
<!-- source: -->
The board is empty at the onset of the game.
Black makes the first move, after which he and White alternate.
A move consists of placing one stone of one's own color on an empty intersection on the board.
A player may pass his turn at any time.
A stone or solidly connected group of stones of one color is captured and removed from the board when all the intersections directly adjacent to it are occupied by the enemy. (Capture of the enemy takes precedence over self-capture.)
No stone may be played so as to recreate an immediately former board position. (simple ko)
Two consecutive passes end the game.
A player's territory consists of all the points he has either occupied or surrounded.
The player with more territory wins.
<Blockbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var a = 123;
var b = 456;
var c = a * b;
if (console) {
//# sourceURL=Blockbehavior.js
<Heightbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var myHeight, testing;
var beh = {
postConfigure: function() {
testing = Math.floor(Math.random() * 10);
myHeight = this.cnode.parent();
act: function() {
toString: function() {
return "testing:" + testing;
//# sourceURL=Heightbehavior.js
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
$wnd.xh.Brickbehavior = function Brickbehavior() {}
$wnd.xh.Brickbehavior.prototype.postConfigure = function() {
this.brick = this.cnode.parent();
this.iam = " red brick";
$wnd.xh.Brickbehavior.prototype.act = function() {
this.brick.println("I am a" + this.iam);
//# sourceURL=Brickbehavior.js
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
console.log("I'm another brick behavior");
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="">
<rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<rect id="PhysicalSystem/Block/Height" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.