It is currently Fri Apr 19, 2024 9:19 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #41 Posted: Mon May 19, 2014 2:26 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
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.

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #42 Posted: Mon May 19, 2014 2:41 am 
Dies in gote

Posts: 57
Liked others: 34
Was liked: 21
Rank: EGF 4d
DGS: XiaoTuzi
Universal go server handle: Kanin
There is this paper from last year:

http://gostyle.j2m.cz/PAPERS/2013-07-Ev ... e_Records/

And in PDF-format:
http://gostyle.j2m.cz/FILES/2013-07-Eva ... ecords.pdf

I remember there was a website where you could post a link to your KGS-account in the archives and it would give you statistics for shape and style. And also give you some names of pros who had similar style. They would also estimate your rank according to your shape habits, and I remember that estimate got better and better. I believe it was the same guys behind that website as this paper, but I'm not sure. Also can't remember where the site could be found.

Anyone else knows?

EDIT: Ah, here it is http://gostyle.j2m.cz/webapp.html


This post by Kanin was liked by: oca
Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #43 Posted: Mon May 19, 2014 2:45 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
Kanin wrote:
There is this paper from last year:

http://gostyle.j2m.cz/PAPERS/2013-07-Ev ... e_Records/

And in PDF-format:
http://gostyle.j2m.cz/FILES/2013-07-Eva ... ecords.pdf

I remember there was a website where you could post a link to your KGS-account in the archives and it would give you statistics for shape and style. And also give you some names of pros who had similar style. They would also estimate your rank according to your shape habits, and I remember that estimate got better and better. I believe it was the same guys behind that website as this paper, but I'm not sure. Also can't remember where the site could be found.

Anyone else knows?

EDIT: Ah, here it is http://gostyle.j2m.cz/webapp.html


Yeah, they were the same guys. Used pachi's capabilities, interesting paper & site :)

_________________
Geek of all trades, master of none: the motto for my blog mostlymaths.net

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #44 Posted: Mon May 19, 2014 2:59 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
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.


Thx Uberdude, just to be sure, that means that :b1: is not a shoulder hit ? as it is not a single stone right ?

Click Here To Show Diagram Code
[go]$$B
$$ . . . . . . |
$$ . . , O . . |
$$ . X 1 . . . |
$$ . . . . . . |[/go]

_________________
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #45 Posted: Mon May 19, 2014 3:14 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
oca wrote:
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.


Thx Uberdude, just to be sure, that means that :b1: is not a shoulder hit ? as it is not a single stone right ?

Click Here To Show Diagram Code
[go]$$B
$$ . . . . . . |
$$ . . , O . . |
$$ . X 1 . . . |
$$ . . . . . . |[/go]


I wouldn't call this a shoulder hit. Usually shoulder-hitting is a mean to a cause: flatten/split the opponent. Having another stone nearby means there was a previous move doing something there, losing this active meaning. My 2 cents, Uberdude will explain it more clearly and rightly ;)

_________________
Geek of all trades, master of none: the motto for my blog mostlymaths.net

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #46 Posted: Mon May 19, 2014 4:36 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
Correct oca

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #47 Posted: Mon May 19, 2014 7:42 am 
Honinbo

Posts: 10905
Liked others: 3651
Was liked: 3374
oca wrote:
Current version of the program tells me that :
Code:
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 |. . . . . . . . . . . . . . . . . . . |
  +--------------------------------------+

"Nobi" -> ok
"Peep" -> ok
but "Shoulder hit"... is this a shoulder hit ? from below :-?


"Crawl" :)

_________________
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #48 Posted: Mon May 19, 2014 2:14 pm 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
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.


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.

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #49 Posted: Tue May 20, 2014 3:07 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
Hi,
What would you say about this one, "empty triangle" or "connection" or both... (or something else)

Code:
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #50 Posted: Tue May 20, 2014 4:47 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #51 Posted: Tue May 20, 2014 5:03 am 
Gosei
User avatar

Posts: 1758
Liked others: 378
Was liked: 375
Rank: 4d
A simple heuristic would be that this shape is an empty triangle, and not a connection. The kosumi was already connected.
Code:
 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.

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #52 Posted: Tue May 20, 2014 9:46 am 
Honinbo

Posts: 10905
Liked others: 3651
Was liked: 3374
oca wrote:
Hi,
What would you say about this one, "empty triangle" or "connection" or both... (or something else)

Code:
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 . . . . . |
  +--------------------------------------+


It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle. :)

_________________
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #53 Posted: Tue May 20, 2014 11:15 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #54 Posted: Wed May 21, 2014 1:19 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
Bill Spight wrote:
It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle. :)

RBerenguel wrote:
Oh, right. Threatens a neat cut at that, but this seems hard to analyse automatically ;)


Oh guzumi, thank you Bill... and yes... that seems very difficult for me to analyse it 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...

Code:

Nobi :
====
   var pattern = [
   "oo?",
   "X1o",
   "oo?"];

   var patternFirstLine = [
   "X1",
   "oo"];
   
   var matching = p.getMatchingPositions(patternFirstLine, stone, game );
   for (var i = 0;i<matching.length;i++) {
      var m = matching[i];
      var s1 = m[0];
      var isFirstLine = (
         (s1.x === 0) ||
         (s1.y === 0) ||
         (s1.x === (game[0].length-1)) ||
         (s1.y === (game.length-1)));
      
         if( isFirstLine) {
            return true;
         }
   }
   return p.isPattern(pattern, stone, game) ;


The main pattern is :

"oo?"
"X1o"
"oo?"

1 : is the last played move
X : is a stone of same color then '1'
o : means "a stone of a different color of '1', or empty
? : means we don't care what is in this position

in the same we but not on that pattern:

'x' would be "a stone of same color of '1' or empty
'O' a stone of a different color of '1'

But just that pattern failed to find nobi on the first line... cause the whole pattern must be containd in the game for the engine to consider that the pattern match a position on the goban.

So I did the "getMatchingPositions(...)" stuff which basicly retrive the position of '1' in another "smaller" pattern and then check if '1' is on first line...
   


_________________
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #55 Posted: Wed May 21, 2014 2:01 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
oca wrote:
Bill Spight wrote:
It's guzumi (see http://senseis.xmp.net/?Guzumi ). Specifically, a good empty triangle. :)

RBerenguel wrote:
Oh, right. Threatens a neat cut at that, but this seems hard to analyse automatically ;)


Oh guzumi, thank you Bill... and yes... that seems very difficult for me to analyse it 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...

Code:

Nobi :
====
   var pattern = [
   "oo?",
   "X1o",
   "oo?"];

   var patternFirstLine = [
   "X1",
   "oo"];
   
   var matching = p.getMatchingPositions(patternFirstLine, stone, game );
   for (var i = 0;i<matching.length;i++) {
      var m = matching[i];
      var s1 = m[0];
      var isFirstLine = (
         (s1.x === 0) ||
         (s1.y === 0) ||
         (s1.x === (game[0].length-1)) ||
         (s1.y === (game.length-1)));
      
         if( isFirstLine) {
            return true;
         }
   }
   return p.isPattern(pattern, stone, game) ;


The main pattern is :

"oo?"
"X1o"
"oo?"

1 : is the last played move
X : is a stone of same color then '1'
o : means "a stone of a different color of '1', or empty
? : means we don't care what is in this position

in the same we but not on that pattern:

'x' would be "a stone of same color of '1' or empty
'O' a stone of a different color of '1'

But just that pattern failed to find nobi on the first line... cause the whole pattern must be containd in the game for the engine to consider that the pattern match a position on the goban.

So I did the "getMatchingPositions(...)" stuff which basicly retrive the position of '1' in another "smaller" pattern and then check if '1' is on first line...
   




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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #56 Posted: Wed May 21, 2014 2:43 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
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)


maybe be not clean enougth or commented enougth for github but here is a zip file that contains it all.

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:
Code:
D:\dev\js\movestat>
D:\dev\js\movestat>node main sgf/a.sgf
Plugin : plugin_count_moves.js
Plugin : plugin_moves.js
Found 1 games in file 'sgf/a.sgf'
----------------------------------------------------------------------
PLUGIN : COUNT MOVES

4 moves
----------------------------------------------------------------------
PLUGIN : MOVE STATISTICS

WARNING :
More a toy then a serious analysis tool...
This is just a prototype, the result is still very... approximative...

                  black   white
                  -----   -----
          Hoshi :     2       2
         Sansan :     0       0
         Tengen :     0       0
         Komoku :     0       0
         Kakari :     0       0
           Nobi :     0       0
         Kosumi :     0       0
           Hane :     0       0
     Ikken tobi :     0       0
     Niken tobi :     0       0
        Kogeima :     0       0
         Ogeima :     0       0
    Daidaigeima :     0       0
      Cross cut :     0       0
           Peep :     0       0
            Cap :     0       0
   Shoulder hit :     0       0
          Tsuke :     0       0
           Bump :     0       0
            Cut :     0       0
Empty triangle :     0       0
  Full triangle :     0       0
           Turn :     0       0
    Bamboo join :     0       0
    Table shape :     0       0
    Tiger mouth :     0       0
        Ponnuki :     0       0
Tortoise Shell :     0       0
   Elephant eye :     0       0
          Crawl :     0       0
         Atari* :     0       0
     Connection :     0       0

=============================================================
Not identified :
Black : 0
White : 0

D:\dev\js\movestat>


Files are :

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 345 times

_________________
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


Last edited by oca on Wed May 21, 2014 3:56 am, edited 1 time in total.

This post by oca was liked by: RBerenguel
Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #57 Posted: Wed May 21, 2014 3:52 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
Another one that explain more in detail the structure that the program use.

Click Here To Show Diagram Code
[go]$$B
$$ +-------------------+
$$ | . . . . . . . . . |
$$ | . . . . . . . . . |
$$ | . . X 1 . . , . . |
$$ | . . . . . . . . . |
$$ | . . . . , . . . . |
$$ | . . . . . . . . . |
$$ | . . , . . . O . . |
$$ | . . . . . . . . . |
$$ | . . . . . . . . . |
$$ +-------------------+[/go]


Code:

for move black 1, the arguments passed to onMove callback function would then be the following :

move : The last played move (black 1) (as given by the sgf parser, usefull to check pass move for instance)
{"B":"dc"}  // warning, this is sgf coords, that will including the letter 'i'

stone : Another represenation of the move that match well with the other parameters. 'c' means 'color' and 1 is for a black stone (2 for a white one)
{"x":3,"y":2,"c":1}

st_group : the group the last played move belongs to.
{
   "stones":[
      {"x":2,"y":2,"c":1},
      {"x":3,"y":2,"c":1}
   ],

   "liberties" : [
      {"x":2,"y":1},
      {"x":2,"y":3},
      {"x":1,"y":2},
      {"x":3,"y":1},
      {"x":3,"y":3},
      {"x":4,"y":2}
   ]
}

game : [
   [0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0],
   [0,0,1,1,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,2,0,0],
   [0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0]
]

st_groups : all groups for actual position.
[
   {
      "stones":[ {"x":2,"y":2,"c":1},{"x":3,"y":2,"c":1}],
      "liberties":[
         {"x":2,"y":1},
         {"x":2,"y":3},
         {"x":1,"y":2},
         {"x":3,"y":1},
         {"x":3,"y":3},
         {"x":4,"y":2}
      ]
   },{
      "stones":[{"x":6,"y":6,"c":2}],
      "liberties":[{"x":6,"y":5},{"x":6,"y":7},{"x":7,"y":6},{"x":5,"y":6}]
   }
]



A simple example plugin to display that kind of stuff :
Code:
var nb = 0;
var buffer ="";
exports.getTitle = function() {
   return "Show structures";
};

exports.onMove = function(move, stone, st_group, game, st_groups) {
   nb ++;
   if (nb == 3) {

      buffer += "game :\n";
      buffer += JSON.stringify(game)+"\n\n";

      buffer += "move :\n";
      buffer += JSON.stringify(move)+"\n\n";

      buffer += "stone :\n";
      buffer += JSON.stringify(stone)+"\n\n";

      buffer += "st_group :\n";
      buffer += JSON.stringify(st_group)+"\n\n";

      buffer += "st_groups :\n";
      buffer += JSON.stringify(st_groups)+"\n\n";
      
   }
};

exports.onFinish = function() {
   console.log(buffer);
};

_________________
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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #58 Posted: Thu May 22, 2014 7:40 am 
Lives with ko
User avatar

Posts: 230
Location: London
Liked others: 288
Was liked: 65
Rank: OGS 2k
OGS: Joellercoaster
RBerenguel wrote:
Lisp programmers are pretty much happy


You rang?

(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

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #59 Posted: Thu May 22, 2014 8:26 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
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
joellercoaster wrote:
RBerenguel wrote:
Lisp programmers are pretty much happy


You rang?

(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 ;))


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.

_________________
Geek of all trades, master of none: the motto for my blog mostlymaths.net

Top
 Profile  
 
Offline
 Post subject: Re: Game moves statistics, any program for that ?
Post #60 Posted: Thu May 22, 2014 1:24 pm 
Honinbo

Posts: 10905
Liked others: 3651
Was liked: 3374
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...

Code:

Nobi :
====
   var pattern = [
   "oo?",
   "X1o",
   "oo?"];

   var patternFirstLine = [
   "X1",
   "oo"];
   
   var matching = p.getMatchingPositions(patternFirstLine, stone, game );
   for (var i = 0;i<matching.length;i++) {
      var m = matching[i];
      var s1 = m[0];
      var isFirstLine = (
         (s1.x === 0) ||
         (s1.y === 0) ||
         (s1.x === (game[0].length-1)) ||
         (s1.y === (game.length-1)));
      
         if( isFirstLine) {
            return true;
         }
   }
   return p.isPattern(pattern, stone, game) ;


The main pattern is :

"oo?"
"X1o"
"oo?"

1 : is the last played move
X : is a stone of same color then '1'
o : means "a stone of a different color of '1', or empty
? : means we don't care what is in this position

in the same we but not on that pattern:

'x' would be "a stone of same color of '1' or empty
'O' a stone of a different color of '1'

But just that pattern failed to find nobi on the first line... cause the whole pattern must be containd in the game for the engine to consider that the pattern match a position on the goban.

So I did the "getMatchingPositions(...)" stuff which basicly retrive the position of '1' in another "smaller" pattern and then check if '1' is on first line...
   




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.


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. :)

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. :( I am not aware of any play called a nobi in the literature where the nobi stone is adjacent to any other stone than the one that it extends. A play that extends towards the edge of the board is generally called a descent. But a play that extends from the 6th line to the 5th line might be called a nobi, I expect. A nobi almost always prevents a hane or block, but I can imagine a case where that might not be so.

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.


This post by Bill Spight was liked by: oca
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group