Search
Showing posts with label java weiqi. Show all posts
Showing posts with label java weiqi. Show all posts
Friday, October 5, 2012
Day 58: To the next step
First of all I want to thank you all that read, comment and send me mails, this gives me a lot of strength to continue with this hard project. Special thanks this time to Xavier and Lic. Sergio that made me see a way to make the code run faster and better.
Here is the way this will continue to start getting less randomization: all the valid moves that the engine have should have a score. There will be a method givePoints that will give points to the move. There I will call all the methods that will have te logic to assign the move some points. Let's say, all moves start with 0 points. To that I will sum a random number from 1 to 5. Then the program will sum and rest points according to the logic that I will give to the program.
Let's start with something simple, then I will make it more and more complex. The first thing I will implement to give points is if the move is in the first turns playing in the corners will give the move 15 points. Closing a Shimari 17 making a kakari 17 (I know in the future I will need to change those values, but let's see).
Labels:
baduk,
board,
computer go,
design,
engine,
go,
igo,
java weiqi,
programming,
weiqi
Thursday, October 4, 2012
Day 57: First video and log
As I promised, here is a video of how is the program working so far.
The program is SLOW, this is because I am logging a lot, it is running on an overcharged computer and is running from a pendrive. So, to save this I should:
The program is SLOW, this is because I am logging a lot, it is running on an overcharged computer and is running from a pendrive. So, to save this I should:
- Make less logging (just log the same info but writing less).
- Sometimes I should run this from a computer that works well, it just plays random moves, it shouldn't take so long to choose a valid move.
- Run it from a hard disk XD.
But, right now what bothers me is how to continue.
The log (10 moves... 206kb.), that is something impossible to keep.
Tuesday, August 21, 2012
Day 13: Groups
It's time for the engine to recognize groups!
A little thing I saw as I was coding this: The size of the board and the moves it have should be part of the board class. So, I am changing all the "size" coming from the main loop, and the methods that received the whole board array.First thing I made is an arraylist that have all the positions of the group. Then I followed this logic:
- Create a pointer variable with value 0, this variable is simply an integer that have the value of the last visited element of the arraylist.
- Start a while loop, all what happens now will be done until I reach the end of the array.
- Search the position to the left in the board, if it have the same value as the first element it adds the position to the arraylist (if it is not in the arraylist yet).
- Search the position to the right in the board, if it have the same value as the first element it adds the position to the arraylist (if it is not in the arraylist yet).
- Search the position up in the board, if it have the same value as the first element it adds the position to the arraylist (if it is not in the arraylist yet).
- Search the position down in the board, if it have the same value as the first element it adds the position to the arraylist (if it is not in the arraylist yet).
- If the pointer is = to the arraylist size of the arraylist, then all the group was found, so it should exit from the loop.
- If the pointer < to the arraylist size, then increase the pointer by one.
- When exits the loop return the arraylist.
After a lot of problems implementing this, I have some code:
I also made a method in Console to show the groups and a method in the engine that gets the groups.
Next step: Liberties.
Labels:
baduk,
engine,
go,
groups,
igo,
java weiqi,
programming,
weiqi
Monday, August 20, 2012
Day 12: Recording moves
I didn't have time this weekend to code, I just started with the game recorder. The class GameWriter takes the integer in the method puthMove and returns a method with getMove. There is also a method with the length of the class.
The main loop class creates a new GameWriter and in every move takes the move. The console writer takes it and writes it translated to coordinates.
Saturday, August 11, 2012
Day 3: Board Representation -Coding-
Well, time to code!
Important note: I just changed: "Stone" is not needed as a class right now, if I need it in the future I will change it, for now, there will be an integer in every position: 0-No stone 1-Black Stone 2-White Stone, 3-Unplayable place
Some things about how I will program this:
- Even if inside an IF there is only one line, I will still use the "{"
- Lot's of comments on code.
- Obvious comments mode=on.
First way I thought about creating the board:
This goes with the math of the last post. Puts the correct "component" in every space of the array.
So, now, just to show it on the console, in the "Console" class:
So, that's it for now, runnig this I had:This goes with the math of the last post. Puts the correct "component" in every space of the array.
So, now, just to show it on the console, in the "Console" class:
In 9x9:
In 19x19:
Subscribe to:
Posts (Atom)