Skip to content

Instantly share code, notes, and snippets.

@kenwebb

kenwebb/xholonWorkbook.xml

Last active Jul 21, 2020
Embed
What would you like to do?
Game of Go
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Tue Jul 21 2020 14:05:58 GMT-0400 (Eastern Daylight Time)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Game of Go
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 6d01bf84182d790658f5034ef7768608
Keywords:
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 LICENSE
n lite.html
Y piece-black.png
Y piece-white.png
? README.md
Y rules.txt
Y style-h5.css
n style-txt.css
n tests.txt
n touch
n touch-info.txt
JS libraries
------------
jquery.min.js
ish.go.js
ish.go.logic.js
ish.go.view.h5.js
NO http://127.0.0.1:8080/war/Xholon.html?app=Game+of+Go&src=lstr&gui=clsc&jslib=gameofgo/jquery.min,gameofgo/ish.go,gameofgo/ish.go.logic,gameofgo/ish.go.view.h5
http://127.0.0.1:8080/war/Xholon.html?app=Game+of+Go&src=lstr&gui=clsc&jslib=jquery-3.5.1,gameofgo/ish.go,gameofgo/ish.go.logic,gameofgo/ish.go.view.h5&hide=xhgui,xhtabs,xhsvg,xhfooter
CSS
---
style-h5.css
References
----------
(1) https://en.wikipedia.org/wiki/Go_(game)
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
(2) https://www.usgo.org/learn-play
(3) https://www.youtube.com/watch?v=gECcsSeRcNo&feature=emb_logo
Video Tutorial for the Game of Go - Part I, Overview (WeiQi, Baduk)
(4) http://tigersmouth.org/viewpage.php?page_id=8
(5) https://github.com/search?l=JavaScript&q=go+game&type=Repositories
(6) http://ismyrnow.github.io/Go/ this works
) https://github.com/ismyrnow/Go
) 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.
GO
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
(7) https://github.com/cjlarose/react-go
http://cjlarose.com/react-go/
(8) https://github.com/waltheri/wgo.js
]]></Notes>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Block/>
<Brick/>
<!-- quantities -->
<Height superClass="Quantity"/>
<GameOfGo/>
</_-.XholonClass>
<xholonClassDetails>
<Block>
<port name="height" connector="Height"/>
</Block>
</xholonClassDetails>
<PhysicalSystem>
<Block>
<Height>0.1 m</Height>
</Block>
<Brick multiplicity="2"/>
<!-- source: https://github.com/ismyrnow/Go/blob/gh-pages/rules.txt -->
<GameOfGo><Anno>
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.
source: https://github.com/ismyrnow/Go/blob/gh-pages/rules.txt
</Anno></GameOfGo>
</PhysicalSystem>
<Blockbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var a = 123;
var b = 456;
var c = a * b;
if (console) {
console.log(c);
}
//# sourceURL=Blockbehavior.js
]]></Blockbehavior>
<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() {
myHeight.println(this.toString());
},
toString: function() {
return "testing:" + testing;
}
}
//# sourceURL=Heightbehavior.js
]]></Heightbehavior>
<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>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
console.log("I'm another brick behavior");
]]></Brickbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Block</title>
<rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Height</title>
<rect id="PhysicalSystem/Block/Height" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
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.