Search

Showing posts with label fuseki. Show all posts
Showing posts with label fuseki. Show all posts

Thursday, November 22, 2012

Day 105: some changes

Well, some fuseki problems that I was seeing in the last days are being solved. giving 17 points to a fuseki position and quitting only 15 if it is a bad move (for example, playing komoku in a corner with a hoshi played by the same color) is something wrong, because it still have 2 points + random number (1,5).

So, first I changed 15 to 25, but still there was something I needed to change: quitting 25 points putting the integer 25 is kind of hardcoding now, so I added a variable in my weightValues class "badFusekiMove" or something like that, giving the value 25.

 So, this is how it played now:


(;FF[4]CA[UTF-8]AP[GoGui:1.4.5] KM[6.5]PW[Evil Tesuji]DT[2012-11-22] ;B[pp];W[dq];B[dd];W[cp];B[nc];W[qq];B[qd];W[cc];B[dc];W[pc] ;B[qc];W[co];B[cj];W[eq];B[qj];W[oc];B[nd];W[bc];B[ob];W[fq] ;B[pb];W[iq];B[pd];W[mq];B[pq];W[po];B[qp];W[nq];B[qr];W[rq])
It is not something to be proud of, but... is slight better.

Friday, October 19, 2012

Day 71: Fuseki and Statistics.

Something that I red on Senseis:

Occurrence in Professional play

The following are statistics for how often the given enclosure was found in professional games in an otherwise empty 10x10 corner. The database used was GoGoD2009 winter edition (with games up to december 2009). Results have been rounded to two significant decimal places:
Enclosures with a 3-4 stone:
  • 5-3 Small knight's move: 19000 times
  • 5-4 One point jump: 6700 times
  • 6-3 Large knight's move: 4300 times
  • 6-4 Two point jump: 330 times
  • 3-7 Two point jump other side: 11 times
Enclosures with a 4-4 stone:
  • 3-6 Small knight's move: 3100 times
  • 3-7 Large knight's move: 2900 times
  • 4-6 One point jump: 730 times
  • 4-7 Two point jump: 380 times
  • 3-8 Very large knight's move: 310 times
  • 3-5 Kosumi: 24 times
Enclosures with a 3-3 stone:
  • 4-6 Large knight's move: 290 times
  • 4-5 Small knight's move: 150 times
  • 3-6 Two point jump: 29 times
  • 3-5 One point jump: 7 times
Enclosures with a 3-5 stone (excluding those already covered):
  • 5-4 High small knight's move: 320 times
  • 6-4 Large knight's move: 150 times
  • 5-5 One point jump up: 130 times
  • 6-3 Two by three jump: 53 times
  • 5-3 Elephant's jump: 7 times
Enclosures with a 4-5 stone (excluding those already covered):
  • 4-5 3-9 Very large knight's move: 50 times
  • 4-5 3-8 Large knight's move: 9 times

Maybe I can use this in the near future...

Thursday, October 18, 2012

Day 70: Some things about fuseki V -making fuseki a little better-

Well, just a theory for fuseki:

For example: If I play 4-4 point, playing 3-4 point is useless (at least at fuseki stage, don't count any joseki, etc.), so in those cases the score for 3-4 should be lowered. 3-3 point is less useless, but should lower the points of being played.

Now, this will make me change some things in my fuseki code. A lot more if's are coming!.

Day 70: Implementing shimari and kakari

This is the way I programmed what I showed in the last posts about shimari and kakari:



What is oneDependsOnAnother? Well... it is to see if the move is in a position and to make something it depends on another move. For example, to make this shimari you need first a komoku. If there is that komoku move and the move is in the 3-5 then return true. Let's see this in code:


public boolean oneDependsOnAnother(int move,int moveEvaluated, int moveDepend, Board board){
        boolean isGood=false;
        if(move==moveEvaluated && board.getMove(moveDepend)!=0){
            isGood=true;
        }
        return isGood;
    }

I can do the same now with other combinations, methods should be similar.

Wednesday, October 17, 2012

Day 69: Errata in 3-5 positions.

Ok, This is bad. Positions for the "lower part of the board" in 19x19 (103,65,117,74 are good) are:

303: (n+1)*15+3
345: (n+1)*17+5
317: (n+1)*16-3
335: (n+1)*17-5

Next, CODE!

Tuesday, October 16, 2012

Day 68: Some things about fuseki V: Shimari



Back to fuseki, let's talk about shimari. The most common shimari is the keima for the 3-4 point (Point 5-3). Again, this is about 8 formulas:

In 19x19:

103=(n+1)*5+3
65=(n+1)*3+5
117=(n+1)*6-3
74=(n+1)*4-6

283=(n+1)*(n-5)+3
324=(n+1)*(n-3)+4
297=(n+1)*(n-4)-3
335=(n+1)*(n-2)-5


I think that this will be valid only for boards... let's say... bigger than 13x13.

So, if a stone is played in a komoku, maybe a shimari is a good move.

Friday, October 12, 2012

Day 64: Some things about Fuseki IV -Komoku-


With the same spirit as the last posts, let´s focus on komoku points (3-4). The difference can be that there are 8 points. This will make me create more formulas, but, it's allright.

In the 9x9 board, komoku are in the points: 34, 36, 43, 47, 74, 76, 63 and 67.

For point 34: (n+1)*3+4.
For point 36: (n+1)*4-4.
For point 43: (n+1)*4+3.
For point 47: (n+1)*5-3.

For point 74: (n+1)*(n-2)+4.
For point 76: (n+1)*(n-1)-4.
For point 63: (n+1)*(n-3)+3.
For point 67: (n+1)*(n-2)-3.

This works for every size.

Thursday, October 11, 2012

Day 63: Some fuseki things III: Hoshi


This is about playing hoshi at fuseki, of course, just talking about 4-4 point. The formulas should be similar to 3-3 point.

In 9x9 the points are: 44, 46, 64 and 66.

Let's see, for 44 the formula (n+1)*4+4 works.
For point 46 the formula is (n+1)*5-4.

For point 64: (n+1)*(n-3)+4= 10*6+4=64
For point 66: (n+1)*(n-2)-4= 10*7-4=66.

Thinking in a 19x19 board, positions are: 84, 96, 324 and 336.

(n+1)*4+4= 20*4+4=84

(n+1)*5-4=20*5-4=96

(n+1)*(n-3)+4= 20*16+4= 324

(n+1)*(n-2)-4 = 20*17 -4= 336

Like in the San San method let's create a isHoshi method:



public boolean isHoshi(int move,Board board){
        boolean isHoshi=false;
        int n=board.getBoardSize();
        if(move==(n+1)*4+4 || move==(n+1)*5-4 || move==(n+1)*(n-3)+4 || move==(n+1)*(n-2)-4){
            isHoshi=true;
        }
        return isHoshi;
    }

Day 63: Some fuseki things II -San San-

Forget what I posted yesterday about san san, that was all wrong, let's supose again (but according to the array) the 9x9 board:

00 01 02 03 04 05 06 07 08 09
10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39

40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59

60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79

80 81 82 83 84 85 86 87 88 89
90 91 92 93 94 95 96 97 98 99
00 01 02 03 04 05 06 07 08 09 10

San San points are 33,37,73 and 77

I can say that point 33 can be reached by the formula (n+1)*3+3 (n is the size in this case 9)= 33.
Point 37 can be reached with formula (n+1)*4-3.

Point 73 can be reached with formula (n+1)*(n-2)+3= 10*7+3=73.
Point 77 can be reached with formula (n+1)*(n-1)-3= 10*8-3=77.

Now, let's see if this works for other sizes:

In a 6x6 board:

00 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 32 33 34
35 36 37 38 39 40 41
42 43 44 45 46 47 48
49 50 51 52 53 54 55 56

San san points are: 24, 25, 31 and 32 (a square in the board).

(n+1)*3+3 = 7*3+3=24
(n+1)*4-3 = 7*4-3=25
(n+1)*(n-2)+3 = 7*4+3=31
(n+1)*(n-1)-3 = 7*5-3=32

In 19x19 San san points (yes, yo lazy to "draw" the board) are 63, 77, 343 and 357


(n+1)*3+3 = 20*3+3=63
(n+1)*4-3 = 20*4-3=77
(n+1)*(n-2)+3 = 20*17+3=343
(n+1)*(n-1)-3 = 20*18-3=357


Right now I think this will work.

So, I will make a method in a class "ShapeRecognizer" called sanSan.





public boolean sansan(int move,Board board){

        boolean isSanSan=false;

        Translator translator=new Translator();

        int n=board.getBoardSize();

        if(move==(n+1)*3+3 || move==(n+1)*4-3 || move==(n+1)*(n-2)+3 || move==(n+1)*(n-1)-3){

            isSanSan=true;

        }

        return isSanSan;

    }






I know is not the best way to do it, but, with time and complexity this will change.

Let's see the result:


Wednesday, October 10, 2012

Day 62: Some Fuseki things



I just want to start giving points to moves, so let's start seeing where are some fuseki points.

Let's imagine a 9x9 board:

9x9 board = 11*10+1=111 positions

01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 00
01 02 03 04 05 06 07 08 09 10 11

Borders are at 1,2,3,4,5,6,7,8,9,10,11,21,31,41,51,61,71,81,91,101,102,103,104,105,106,107,108,109,110,111

For San-San

So, our "san san points" (3-3) are at 34, 38, 74 and 78.

The point is that I need a generic way to calculate san san. 

How do I know that ar 34 I have a san san? 

(Note: n in this context is the size of the board, in this case 9).

point-3 = border. 
point-3*(n+1)=border
For 38:

point+3=border
point-3*(n+1)=border 

For 74: 

point-3 = border.
point+3*(n+1)=border

For 78


point+3 = border.
point+3*(n+1)=border

This will search for borders at 3 spaces: 


  • For 34 will search for 31 and 4
  • For 38 will search for 41 and 8
  • For 74 will search for 71 and 104
  • For 78 will search for 81 and 108
I think This works for every board size.

For Hoshi in fuseki

What you red, change 3 with 4.