Game moves statistics, any program for that ?
-
Uberdude
- Judan
- Posts: 6727
- Joined: Thu Nov 24, 2011 11:35 am
- Rank: UK 4 dan
- GD Posts: 0
- KGS: Uberdude 4d
- OGS: Uberdude 7d
- Location: Cambridge, UK
- Has thanked: 436 times
- Been thanked: 3718 times
-
Bill Spight
- Honinbo
- Posts: 10905
- Joined: Wed Apr 21, 2010 1:24 pm
- Has thanked: 3651 times
- Been thanked: 3373 times
Re: Game moves statistics, any program for that ?
"Crawl"oca wrote:Current version of the program tells me that :"Nobi" -> okCode: Select all
MOVE : 9, ["Nobi","Peep","Shoulder hit"] 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 +--------------------------------------+ 0 |. . . . . . . . . . . . . . . . . . . | 1 |. . . . . . . . . . . . . . . . . . . | 2 |. . . . . . . . . . . . . . . . . . . | 3 |. . . X . . . . . X . . . X . X . . . | 4 |. . . . . . . . . . . . . . . . X . . | 5 |. . . . . . . . . . . . . . . O O . . | 6 |. . . . . . . . . . . . . . . . . . . | 7 |. . . . . . . . . . . . . . . . X . . | 8 |. . . . . . . . . . . . . . . . .(O). | 9 |. . . X . . . . . X . . . . . X X O . | 0 |. . . . . . . . . . . . . . . . . O . | 1 |. . . . . . . . . . . . . . . . . . . | 2 |. . . . . . . . . . . . . . . . . . . | 3 |. . . . . . . . . . . . . . . . . . . | 4 |. . . . . . . . . . . . . . . . . . . | 5 |. . . X . . . . . X . . . . . X . . . | 6 |. . . . . . . . . . . . . . . . . . . | 7 |. . . . . . . . . . . . . . . . . . . | 8 |. . . . . . . . . . . . . . . . . . . | +--------------------------------------+
"Peep" -> ok
but "Shoulder hit"... is this a shoulder hit ? from below
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.
-
Uberdude
- Judan
- Posts: 6727
- Joined: Thu Nov 24, 2011 11:35 am
- Rank: UK 4 dan
- GD Posts: 0
- KGS: Uberdude 4d
- OGS: Uberdude 7d
- Location: Cambridge, UK
- Has thanked: 436 times
- Been thanked: 3718 times
Re: Game moves statistics, any program for that ?
Actually maybe just single stones with fewer liberties are ok too: if you play diagonally above a stone on the edge with 3 liberties, or 2-2 to a 1-1 stone with 2 liberties perhaps that can be called a shoulder hit too, though it's so strange to have 1st line stones like that it's unlikely to ever happen in a real game.Uberdude wrote:A shoulder hit is only from above: the hitter must be nearer the centre than the hitee so you can't use pure local pattern matching. It's normal for it to be 4th line hitting 3rd but not necessary. Also both stones should be single stones with 4 liberties.
- oca
- Lives in gote
- Posts: 699
- Joined: Wed Feb 19, 2014 2:53 am
- Rank: DDK
- GD Posts: 0
- KGS: aco
- IGS: oca
- OGS: oca
- Location: Switzerland
- Has thanked: 485 times
- Been thanked: 166 times
Re: Game moves statistics, any program for that ?
Hi,
What would you say about this one, "empty triangle" or "connection" or both... (or something else)
What would you say about this one, "empty triangle" or "connection" or both... (or something else)
Code: Select all
MOVE : 76, []
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
+--------------------------------------+
0 |. . . O . . . O . . . . . . . . . . . |
1 |. X O . . . O . O X . . O X . . . . . |
2 |. . X O O O X O X X . O . X . . . . . |
3 |. . X X . . X X . X . . . X . X . . . |
4 |. . . . . . . . . . . O . . . . X . . |
5 |. . . . . . . . . . O . . . X O O X . |
6 |. . X . . . . . . . . . . . O . . . . |
7 |. . . . . . . . . . . . . . O X X X . |
8 |. . . . . . . . . . . . . . . O O O . |
9 |. . . X . . . . . X . . . . . X X O . |
0 |. . . . . . . . . . . . . . . . . O . |
1 |. . . . . . . . . . . . . . . . . . . |
2 |. O . . . . . . . . . . . . . . . . . |
3 |. . O . X . . . . . . . . . . . X . . |
4 |. O X . . . . O . O . . . . . . . . . |
5 |. .(X)X X . . X O X . . . . X X X . . |
6 |. . O O X . . X O X . . . O X O O . . |
7 |. . . . X . . X O . . . O . O X X . . |
8 |. . . . . . . . . . . . . O . . . . . |
+--------------------------------------+
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
- RBerenguel
- Gosei
- Posts: 1585
- Joined: Fri Nov 18, 2011 11:44 am
- Rank: KGS 5k
- GD Posts: 0
- KGS: RBerenguel
- Tygem: rberenguel
- Wbaduk: JohnKeats
- Kaya handle: RBerenguel
- Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
- Location: Barcelona, Spain (GMT+1)
- Has thanked: 576 times
- Been thanked: 298 times
- Contact:
Re: Game moves statistics, any program for that ?
Empty triangle. Wouldn't say connection because there was no threat to cut, but this is a little wavy to do programatically anyway
Geek of all trades, master of none: the motto for my blog mostlymaths.net
- Dusk Eagle
- Gosei
- Posts: 1758
- Joined: Tue Apr 20, 2010 4:02 pm
- Rank: 4d
- GD Posts: 0
- Has thanked: 378 times
- Been thanked: 375 times
Re: Game moves statistics, any program for that ?
A simple heuristic would be that this shape is an empty triangle, and not a connection. The kosumi was already connected.
Code: Select all
X .
(X)X
We don't know who we are; we don't know where we are.
Each of us woke up one moment and here we were in the darkness.
We're nameless things with no memory; no knowledge of what went before,
No understanding of what is now, no knowledge of what will be.
Each of us woke up one moment and here we were in the darkness.
We're nameless things with no memory; no knowledge of what went before,
No understanding of what is now, no knowledge of what will be.
-
Bill Spight
- Honinbo
- Posts: 10905
- Joined: Wed Apr 21, 2010 1:24 pm
- Has thanked: 3651 times
- Been thanked: 3373 times
Re: Game moves statistics, any program for that ?
It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle.oca wrote:Hi,
What would you say about this one, "empty triangle" or "connection" or both... (or something else)
Code: Select all
MOVE : 76, [] 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 +--------------------------------------+ 0 |. . . O . . . O . . . . . . . . . . . | 1 |. X O . . . O . O X . . O X . . . . . | 2 |. . X O O O X O X X . O . X . . . . . | 3 |. . X X . . X X . X . . . X . X . . . | 4 |. . . . . . . . . . . O . . . . X . . | 5 |. . . . . . . . . . O . . . X O O X . | 6 |. . X . . . . . . . . . . . O . . . . | 7 |. . . . . . . . . . . . . . O X X X . | 8 |. . . . . . . . . . . . . . . O O O . | 9 |. . . X . . . . . X . . . . . X X O . | 0 |. . . . . . . . . . . . . . . . . O . | 1 |. . . . . . . . . . . . . . . . . . . | 2 |. O . . . . . . . . . . . . . . . . . | 3 |. . O . X . . . . . . . . . . . X . . | 4 |. O X . . . . O . O . . . . . . . . . | 5 |. .(X)X X . . X O X . . . . X X X . . | 6 |. . O O X . . X O X . . . O X O O . . | 7 |. . . . X . . X O . . . O . O X X . . | 8 |. . . . . . . . . . . . . O . . . . . | +--------------------------------------+
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.
- RBerenguel
- Gosei
- Posts: 1585
- Joined: Fri Nov 18, 2011 11:44 am
- Rank: KGS 5k
- GD Posts: 0
- KGS: RBerenguel
- Tygem: rberenguel
- Wbaduk: JohnKeats
- Kaya handle: RBerenguel
- Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
- Location: Barcelona, Spain (GMT+1)
- Has thanked: 576 times
- Been thanked: 298 times
- Contact:
Re: Game moves statistics, any program for that ?
Oh, right. Threatens a neat cut at that, but this seems hard to analyse automatically 
Geek of all trades, master of none: the motto for my blog mostlymaths.net
- oca
- Lives in gote
- Posts: 699
- Joined: Wed Feb 19, 2014 2:53 am
- Rank: DDK
- GD Posts: 0
- KGS: aco
- IGS: oca
- OGS: oca
- Location: Switzerland
- Has thanked: 485 times
- Been thanked: 166 times
Re: Game moves statistics, any program for that ?
Bill Spight wrote: It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle.
Oh guzumi, thank you Bill... and yes... that seems very difficult for me to analyse it automatically...RBerenguel wrote:Oh, right. Threatens a neat cut at that, but this seems hard to analyse automatically
Even Nobi was more complex then excpeted... my first try found "Nobi" moves everywhere....
Current version of Nobi is slightly becoming "une usine à gaz" like we say in french (a "gas factory" ? do we say that in english ? or is it "white elephant" ???) anyway here is the code for whose who may be interested...
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
- RBerenguel
- Gosei
- Posts: 1585
- Joined: Fri Nov 18, 2011 11:44 am
- Rank: KGS 5k
- GD Posts: 0
- KGS: RBerenguel
- Tygem: rberenguel
- Wbaduk: JohnKeats
- Kaya handle: RBerenguel
- Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
- Location: Barcelona, Spain (GMT+1)
- Has thanked: 576 times
- Been thanked: 298 times
- Contact:
Re: Game moves statistics, any program for that ?
oca wrote:Bill Spight wrote: It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle.Oh guzumi, thank you Bill... and yes... that seems very difficult for me to analyse it automatically...RBerenguel wrote:Oh, right. Threatens a neat cut at that, but this seems hard to analyse automatically
Even Nobi was more complex then excpeted... my first try found "Nobi" moves everywhere....
Current version of Nobi is slightly becoming "une usine à gaz" like we say in french (a "gas factory" ? do we say that in english ? or is it "white elephant" ???) anyway here is the code for whose who may be interested...
Hmmm... not sure if this applies to Sensei's definition of nobi. I hope Bill chimes in for this, but seems like nobi needs to be "moving ahead", getting more liberties. So in your template, at least some of the o's around 1 should be empty to satisfy this (but there are more conditions for this to work anyway.) Btw, you write very readable JS, if you put it up somewhere (github? bitbucket?) I'll sure give it a look in its entirety (if my node.js install works, haven't checked on this computer)
Geek of all trades, master of none: the motto for my blog mostlymaths.net
- oca
- Lives in gote
- Posts: 699
- Joined: Wed Feb 19, 2014 2:53 am
- Rank: DDK
- GD Posts: 0
- KGS: aco
- IGS: oca
- OGS: oca
- Location: Switzerland
- Has thanked: 485 times
- Been thanked: 166 times
Re: Game moves statistics, any program for that ?
maybe be not clean enougth or commented enougth for github but here is a zip file that contains it all.RBerenguel wrote:if you put it up somewhere (github? bitbucket?) I'll sure give it a look in its entirety (if my node.js install works, haven't checked on this computer)
you just need to extract that somewhere.
then you need nodejs...
and then you can quickly just try that command :
D:\dev\js\movestat>node main sgf/a.sgf
which should gives you the following result:
main.js : the main program file, that take care of reading the sgf file and then invoke some plugins for each moves.
ascii.js : just a quick one to echo a basic ascii board... mainly for debug...
engine.js and group.js : rule engine, not the cleanest one... an old one I use to quickly write as a test...
pattern.js : used to generate rotated and mirrored patterns, and to see if they match in a game
So... main.js read a given file (or a dir and then iterate on each of the files),
for each file, it loops for each of the games and finally, loops for each moves in the game (taking only the first variation path)
Now comes the notion of plugin... a plugin is a file that should be in the plugins dir, and that should not start with the _ char (so that we can disable them easily by just changing their name).
Each plugin should expose 3 functions :
- getTitle that just return the name of the plugin as a string
- onFinish, which is called by the engine at the really end of all files/games/moves handling, this is where the plugin should echo things...
- and onMove : which is where a move is sent by the engine to the plugin.
onMove recieve some data to do its work.
- a "move" , which is an object representing the move as sent by the sgf parser
- a "stone", which is very similar to the move, but in another form (yes it's a bit redondant...)
- a "st_group" which is a structure of a group (this is the group that the stone belong to) a group structure contains its stones and liberties
- a game which is... the game.... (as an array of array [line1, line2,...line19] where lines are somthing like [0,0,1,2,0,...,1], 0 being empty, 1 is black and 2 is white... ), game[0][0] is top / left
- st_groups is a list of all groups at current position (again with their stones and liberties)
the easiest way to start is to look at the file "plugins/plugin_count_moves.js" and play with it echoing the structures
with code like JSON.stringify (st_group,null,2); for instance.
The move analysis part in in the file "plugins/plugin_moves.js" and is basicly a big list of moves, each with a name and a function called "is" that should return "true" is the last play move is of its shape...
Ok, that should be enougth for a starting point I hope...
PS: if that just don't work, may be try to install the sgf parser manually with command :
"npm install smartgame" as told here "https://www.npmjs.org/package/smartgame"
- Attachments
-
- movestat.zip
- (41.63 KiB) Downloaded 464 times
Last edited by oca on Wed May 21, 2014 3:56 am, edited 1 time in total.
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
- oca
- Lives in gote
- Posts: 699
- Joined: Wed Feb 19, 2014 2:53 am
- Rank: DDK
- GD Posts: 0
- KGS: aco
- IGS: oca
- OGS: oca
- Location: Switzerland
- Has thanked: 485 times
- Been thanked: 166 times
Re: Game moves statistics, any program for that ?
Another one that explain more in detail the structure that the program use.
A simple example plugin to display that kind of stuff :
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
- joellercoaster
- Lives with ko
- Posts: 230
- Joined: Mon Sep 16, 2013 5:50 am
- Rank: OGS 2k
- GD Posts: 0
- OGS: Joellercoaster
- Location: London
- Has thanked: 288 times
- Been thanked: 65 times
- Contact:
Re: Game moves statistics, any program for that ?
You rang?RBerenguel wrote:Lisp programmers are pretty much happy
(Not done Common Lisp in a few decades so CLOS is forever in the past, but Clojure is a very comfortable modern Lisp and you're right - OO is something I think about little indeed
Confucius in the Analects says "even playing go is better than eating chips in front of tv all day." -- kivi
- RBerenguel
- Gosei
- Posts: 1585
- Joined: Fri Nov 18, 2011 11:44 am
- Rank: KGS 5k
- GD Posts: 0
- KGS: RBerenguel
- Tygem: rberenguel
- Wbaduk: JohnKeats
- Kaya handle: RBerenguel
- Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
- Location: Barcelona, Spain (GMT+1)
- Has thanked: 576 times
- Been thanked: 298 times
- Contact:
Re: Game moves statistics, any program for that ?
I don't understand what "rang" means here... But yes, I've programmed in Common Lisp (probably the only relevant program for the world is my code to generate Lavaurs chords, which has been improved by other people meanwhile) in the past. Not much any more, though (I still code a bit in Emacs Lisp, so my Lisp fix is always close at hand) since for most tasks I'm faster in Go, Javascript or some kludge with awk. Or when I need to go full crazy with what I'm doing and how to solve it, lately it means (likely) try to do it in Prolog or APL.joellercoaster wrote:You rang?RBerenguel wrote:Lisp programmers are pretty much happy
(Not done Common Lisp in a few decades so CLOS is forever in the past, but Clojure is a very comfortable modern Lisp and you're right - OO is something I think about little indeed)
Geek of all trades, master of none: the motto for my blog mostlymaths.net
-
Bill Spight
- Honinbo
- Posts: 10905
- Joined: Wed Apr 21, 2010 1:24 pm
- Has thanked: 3651 times
- Been thanked: 3373 times
Re: Game moves statistics, any program for that ?
IMO, the Sensei's page suffers from having been written by a committee of amateurs. That is not to say that Japanese amateurs do much better. I expect that Hayashi gives a good definition, but I do not have it. Perhaps John Fairbairn will chime in.RBerenguel wrote:oca wrote: Even Nobi was more complex then excpeted... my first try found "Nobi" moves everywhere....
Current version of Nobi is slightly becoming "une usine à gaz" like we say in french (a "gas factory" ? do we say that in english ? or is it "white elephant" ???) anyway here is the code for whose who may be interested...
Hmmm... not sure if this applies to Sensei's definition of nobi. I hope Bill chimes in for this, but seems like nobi needs to be "moving ahead", getting more liberties.
Anyway, the necessary core of the idea of a nobi is that it extends a stone by playing next to it, thereby strengthening or reinforcing it. The trouble is, as oca indicates, many moves that do that are called something else.
Edit: For reference, you might enjoy this page: http://senseis.xmp.net/?BillSpight%2FStep
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.
At some point, doesn't thinking have to go on?
— Winona Adkins
Visualize whirled peas.
Everything with love. Stay safe.