Well, there are 2 videos I didn't add to the blog, here is the one for day 6, some Data was added that day in a class that will content all the "constants" of the program.
Search
Showing posts with label go board. Show all posts
Showing posts with label go board. Show all posts
Tuesday, August 20, 2013
Creating a go program, day 6
Friday, August 16, 2013
Evil Tesuji, day 3, Board representation
Me again in video! I took ideas from my old posts about board representation and compiled them in the video:
Well, I think that this video log is a good idea, right now I am more concentrated on the program.
Tuesday, December 4, 2012
Day 117: Readers always are right
On my day 99 post, a reader, Steve, pointed at something that is right. I am using a lot up, down, left and right, so, it is better to create methods for that. I will create them in board class.
public int up(int move){ int play; play=this.getMove(move-this.getBoardSize()+1); return play; } public int down(int move){ int play; play=this.getMove(move+this.getBoardSize()+1); return play; } public int left(int move){ int play; play=this.getMove(move-1); return play; } public int right(int move){ int play; play=this.getMove(move+1); return play; }
Labels:
baduk,
computer go,
engine,
go board,
java,
programming,
weiqi
Thursday, October 11, 2012
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.
I know is not the best way to do it, but, with time and complexity this will change.
Let's see the result:
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:
Labels:
baduk,
board,
computer go,
engine,
fuseki,
go,
go board,
igo,
java,
programming,
weichi,
weiqi
Saturday, September 1, 2012
Day 24: Stupid errors, the most common and hard.
I really think that the stupid errors the most obvious are sometimes the hardest to find and correct. In the old days a ";" were a problem and now some "logic" errors in big messes are a big deal. As I said I was changing all the main loop (and will change more things to organize and make code clearer) and implementing GTP commands. When I ran the program using GoGui it sent me inexistent positions in the board and when I ran the program using my console the result was good. After a lot of research of "what the hell is going on", the error was that I implemented the clear board command using boardInitialize of my board class and it added more positions to the arrayList. So, now I can play with goGui randomly and not using the suicide rule.
Thursday, August 23, 2012
Day 15: Killing groups
Now that the engine can see groups and count liberties (and see where are the liberties), the obvious step is to see if a group is killed. Basically when someone plays the board will look using the ruleset if any group have 0 liberties. If it is the case, all those positions becomes empty (value of the position = 0), and the number of dead stones should increase to a "dead stones" variable for the outsider or the engine.
This is the "search for liberties" method (I didn't publish it yesterday, you have it now):
Labels:
baduk,
computer go,
engine,
go,
go board,
igo,
java,
programming,
weiqi
Friday, August 17, 2012
Day 9: Midnight reflection.
Midnight, I can't sleep, my go sucks, barely won my third game, and because my opponent mada a big mistake (bigger than all the mistakes I made). Well, a list of things for the future days:
- Send the possibleMoves method to the rules (and then delete Actors class).
- Start saving all the moves done in the game and show them in the console class. Right now some println are in the main loop.
- Start searching for groups.
- When I can find groups, I need to count liberties.
- If liberties=0 then kill.
- KO.
- Eyes (?)
- GTP.
- Seki
- Montecarlo.
- Conquer the world.
A video about computer go:
Saturday, August 11, 2012
Day 3: Changes in board...
Another thing that I changes was the main class. The game loop should not be in the main class, the main class only calls a "game loop" class, so now I have gameLoop class.
Subscribe to:
Posts (Atom)




