Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old January 4th 10, 07:06 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Sep 2007
Posts: 184
Default new java chess program

Here is a java chess program that I have written:

http://web.telia.com/~u89404340/javachess/index.html

Its main feature is that it is not extremely strong, so you should
actually be able to beat it if you manage to avoid tactical errors.

--
Peter Osterlund -
http://web.telia.com/~u89404340
  #2   Report Post  
Old January 4th 10, 02:32 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: May 2006
Posts: 179
Default new java chess program

On Mon, 04 Jan 2010 07:06:42 GMT, Peter Osterlund
wrote:

Here is a java chess program that I have written:

http://web.telia.com/~u89404340/javachess/index.html

Its main feature is that it is not extremely strong, so you should
actually be able to beat it if you manage to avoid tactical errors.


Thanks Peter, it's always nice to see a program from a newsgroup
regular.

I won my first game against it, at 5 sec/move for your program, and
much more time taken on my part. My tactics are ugly past move 22.

1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. d4 d6 5. exd6 cxd6 6. Nf3 Nc6 7. Nc3
Bg4 8. Be2 Na5 9. b3 Rc8 10. Be3 g6 11. O-O Bg7 12. h3 Bd7 13. Rc1 O-O
14. d5 Qc7 15. Qd2 Na8 16. Bh6 Nb6 17. Bxg7 Kxg7 18. Qd4+ Kg8 19. Qh4
e6 20. Ng5 h5 21. Bxh5 gxh5 22. Qxh5 Kg7 23. Nce4 Rh8 24. Qg4 Kf8 25.
dxe6 Bxe6 26. Nxe6+ fxe6 27. Qxe6 Qe7 28. Qf5+ Kg7 29. Rfe1 Qe5 30.
Qg4+ Kf8 31. Re3 Nc6 32. Rf3+ Ke7 33. Rf5 Qd4 34. Qg5+ Ke8 35. Re1 Ne7
36. Nf6+ Kd8 37. Rxe7 Qd1+ 38. Kh2 Rb8 39. Nd5 Nxd5 40. Rxd5 Qxd5 41.
cxd5 Rh5 42. Qg7 Rf5 43. Rd7+ Kc8 44. Rc7+ Kd8 45. Qe7# 1-0

Here is a game at 5 sec/move per side against a TSCP derived Java
applet ( home page: http://english.op.org/~peter/ChessApp/ ). Your
program plays white, and wins:

1. g3 e5 2. Bg2 d5 3. Nc3 d4 4. Na4 Nf6 5. Nf3 Bd6 6. O-O O-O 7. d3
Qe8 8. b3 Bg4 9. Bg5 Nbd7 10. Nd2 c6 11. Nc4 Qb8 12. Nxd6 Qxd6 13. c4
Bf5 14. Qc2 Ng4 15. c5 Qg6 16. Be7 Rfe8 17. Bh4 e4 18. dxe4 Bxe4 19.
Bxe4 Qxe4 20. Qxe4 Rxe4 21. f3 Rxe2 22. fxg4 Ne5 23. g5 d3 24. Nc3 Re3
25. Rad1 Re8 26. Kf2 Ng4+ 27. Kg2 Ne5 28. Rde1 Ng4 29. Rd1 Ne5 30. Rd2
b6 31. cxb6 axb6 32. a4 Re6 33. Rf4 Re1 34. Rb4 c5 35. Re4 Rxe4 36.
Nxe4 h6 37. gxh6 Rxh6 38. a5 f5 39. a6 Re6 40. Nd6 Nc6 41. Rxd3 Re2+
42. Kf1 Ra2 43. Nxf5 Rxa6 44. Rd7 Ra7 45. Rxa7 Nxa7 46. Bd8 Nc8 47.
Ke2 Kf7 48. Bc7 g6 49. Ne3 b5 50. h4 Ke6 51. g4 Ne7 52. h5 gxh5 53.
gxh5 Nf5 54. Nxf5 Kxf5 55. h6 Kg6 56. Bf4 Kh7 57. Kd3 Kg6 58. Ke4 c4
59. bxc4 bxc4 60. Kd4 c3 61. Kxc3 Kh7 62. Kd4 Kg6 63. Ke5 Kf7 64. Kf5
Kg8 65. Kg6 Kf8 66. h7 Ke7 67. h8Q

Some weird glitch happened with the other applet at this point, but,
of course, white mates in a few moves.
  #3   Report Post  
Old January 5th 10, 08:29 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Sep 2007
Posts: 184
Default new java chess program

Tony M writes:

On Mon, 04 Jan 2010 07:06:42 GMT, Peter Osterlund
wrote:

Here is a java chess program that I have written:

http://web.telia.com/~u89404340/javachess/index.html

Its main feature is that it is not extremely strong, so you should
actually be able to beat it if you manage to avoid tactical errors.


Thanks Peter, it's always nice to see a program from a newsgroup
regular.


Hi, and thanks for testing the program.

I won my first game against it, at 5 sec/move for your program, and
much more time taken on my part. My tactics are ugly past move 22.


Well, that's ok since the game is easily won by white after move 22
anyway.

1. e4 Nf6


I wonder why it seems to like Nf6 so much. I think the random number
generator built into java is maybe not "random enough".

2. e5 Nd5 3. c4 Nb6 4. d4 d6 5. exd6 cxd6 6. Nf3 Nc6 7. Nc3
Bg4 8. Be2 Na5


a5 is a bad square for the knight in this game. Too bad my program
didn't realize that until it was too late.

9. b3 Rc8 10. Be3 g6 11. O-O Bg7 12. h3 Bd7 13. Rc1 O-O
14. d5 Qc7 15. Qd2 Na8 16. Bh6 Nb6 17. Bxg7 Kxg7 18. Qd4+ Kg8 19. Qh4
e6 20. Ng5


It's pretty much game over here. I wonder why it played e6 though. My
current version prefers f6 (which also seems to lose, but not as
quickly). Either it is because I have tweaked the evaluation function
since you played your game, or it's because your computer doesn't have
the same speed as mine. I have a 2.4GHz Core2. What computer did you
use?

h5 21. Bxh5 gxh5 22. Qxh5 Kg7 23. Nce4 Rh8 24. Qg4


According to stockfish, you missed a mate-in-4 he

24. Qxf7 Kh6 25. Qf6+ Kh5 26. Ng3+ Kh4 27. Nxe6#

Not that it matters of course, since the game is easily won anyway.

Here is a game at 5 sec/move per side against a TSCP derived Java
applet ( home page: http://english.op.org/~peter/ChessApp/ ). Your
program plays white, and wins:

1. g3 e5 2. Bg2 d5 3. Nc3


Out of book at move 3. Not good. I suppose I should add more opening
book lines.

d4 4. Na4


And again the program gets its knight into an awkward situation.

Nf6 5. Nf3 Bd6 6. O-O O-O 7. d3 Qe8 8. b3 Bg4 9. Bg5 Nbd7 10. Nd2 c6
11. Nc4 Qb8 12. Nxd6 Qxd6 13. c4 Bf5 14. Qc2 Ng4 15. c5 Qg6 16. Be7
Rfe8 17. Bh4


And now it gets the bishop into an awkward situation too.

e4


Strange. My program immediately sees that this move loses approximately
one pawn. (And stockfish agrees.) I wonder why the other program didn't
see that.

18. dxe4 Bxe4 19. Bxe4 Qxe4 20. Qxe4 Rxe4 21. f3 Rxe2
22. fxg4 Ne5 23. g5 d3 24. Nc3 Re3 25. Rad1 Re8 26. Kf2 Ng4+ 27. Kg2
Ne5 28. Rde1 Ng4 29. Rd1 Ne5 30. Rd2 b6 31. cxb6 axb6 32. a4 Re6
33. Rf4 Re1 34. Rb4 c5 35. Re4 Rxe4 36. Nxe4 h6 37. gxh6 Rxh6 38. a5
f5 39. a6 Re6 40. Nd6 Nc6 41. Rxd3 Re2+ 42. Kf1 Ra2 43. Nxf5 Rxa6
44. Rd7 Ra7 45. Rxa7 Nxa7 46. Bd8 Nc8 47. Ke2 Kf7 48. Bc7 g6 49. Ne3
b5 50. h4 Ke6 51. g4 Ne7 52. h5 gxh5 53. gxh5 Nf5 54. Nxf5 Kxf5
55. h6 Kg6 56. Bf4 Kh7 57. Kd3 Kg6 58. Ke4 c4 59. bxc4


My program was a bit lucky here that the bishop had the right color,
because I haven't taught it yet that a wrong color bishop and a rook
pawn can't win if the opponent's king controls the promotion square. I
don't think it would have found this out on its own by searching for
just 5 seconds.

--
Peter Osterlund -
http://web.telia.com/~u89404340
  #4   Report Post  
Old January 6th 10, 10:25 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: May 2006
Posts: 179
Default new java chess program

On Tue, 05 Jan 2010 20:29:28 GMT, Peter Osterlund
wrote:

Tony M writes:



It's pretty much game over here. I wonder why it played e6 though. My
current version prefers f6 (which also seems to lose, but not as
quickly). Either it is because I have tweaked the evaluation function
since you played your game, or it's because your computer doesn't have
the same speed as mine. I have a 2.4GHz Core2. What computer did you
use?


It's a much slower machine, an AMD Turion laptop. I can't remember if
I was running full speed at 1.6 GHz, or in power saver mode at 0.8
GHz. There is a newer version of your program on the web site now, so
perhaps that makes a difference too.

I was trying out the .jar version of the program in text mode, and I
notice that some of the commands are the same as or close to winboard
commands. Have you thought about adding Winboard (or UCI) support?

Another test game, this time against Little ChessPartner 1.12 (your
program as White):

1. e4 g6 2. Nc3 Nc6 3. Nf3 Nf6 4. Bb5 d5 5. e5 Ne4 6. O-O Bf5 7. Bxc6+
bxc6 8. Na4 e6 9. Nd4 c5 10. Nxf5 exf5 11. d3 Ng5 12. b3 Ne6 13. Re1
Bg7 14. Ba3 Bf8 15. Qd2 d4 16. Qa5 c6 17. Qd2 Be7 18. Qh6 Bg5 19. Qh3
Bd2 20. Red1 Ng5 21. Qg3 f4 22. Qg4 h5 23. Qe2 Bb4 24. Bc1 Ne6 25. Bb2
O-O 26. Rac1 f6 27. Qe4 Qe8 28. exf6 Rxf6 29. c3 dxc3 30. Bxc3 Nd4 31.
Bxd4 Qxe4 32. dxe4 cxd4 33. Rxd4 a5 34. Nc5 Ba3 35. Rc2 g5 36. e5 Rf5
37. Nd7 Rc8 38. Rd1 g4 39. e6 c5 40. Nb6 Re8 41. Nc4 Rxe6 42. Nxa3 Kf7
43. Nc4 Rd5 44. Rcc1 Rxd1+ 45. Rxd1 h4

And here I misentered a move, but your program is winning easily. It
took nice advantage of pawn weaknesses.

And a game against Jester, a long maneuvering game. Jester can't make
progress on the queenside, then starts to move the pawns in front of
his king, eventually self destructing:

1. e4 d5 2. exd5 Nf6 3. d4 Nxd5 4. c4 Nb6 5. Nc3 g6 6. Bf4 Bg7 7. Nf3
O-O 8. h3 Na6 9. c5 Nd5 10. Nxd5 Qxd5 11. Bxa6 Qe4+ 12. Be3 bxa6 13.
O-O Bb7 14. Qa4 Qe6 15. Ng5 Qd5 16. Nf3 Qe6 17. Ne1 Rab8 18. Rd1 Rfd8
19. Qa5 Rbc8 20. b3 Rd7 21. Qa4 Rcd8 22. Rd2 Be4 23. Qa5 Qc6 24. f3
Bb1 25. Rd1 Bf5 26. g4 Be6 27. Nc2 Qb5 28. Qe1 a5 29. Na3 Qa6 30. Nc2
Qb5 31. Na3 Qb7 32. Qxa5 Bd5 33. Kg2 Bc6 34.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rxe5 Rg1+ 121. Re1 f2 122. Kc1 fxe1Q+ 123. Kb2 Qa1+ 124. Kb3 Rb1#
0-1

I would post some more of my old games, but they're all ugly
embarrassing defeats.

Pretty good little applet.
  #5   Report Post  
Old January 6th 10, 06:54 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Sep 2007
Posts: 184
Default new java chess program

Tony M writes:

I was trying out the .jar version of the program in text mode, and I
notice that some of the commands are the same as or close to winboard
commands. Have you thought about adding Winboard (or UCI) support?


I have thought about adding UCI support, but haven't gotten around to it
yet. (With the "polyglot" UCI-winboard adapter, this would also make it
possible to use the engine with xboard/winboard.)

Another test game, this time against Little ChessPartner 1.12 (your
program as White):

....

And here I misentered a move, but your program is winning easily. It
took nice advantage of pawn weaknesses.


I have added undo/redo buttons in my GUI, so if you misenter a move
there you can just undo and try again.

And a game against Jester, a long maneuvering game. Jester can't make
progress on the queenside, then starts to move the pawns in front of
his king, eventually self destructing:


This agrees with my impression from playing against Jester. The games
are usually roughly equal for a while, until Jester appears to prefer
making bad moves instead of just doing nothing and perhaps get a draw.

--
Peter Osterlund -
http://web.telia.com/~u89404340


  #6   Report Post  
Old January 6th 10, 08:38 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default new java chess program

* Peter Osterlund (19:54) schrieb:

Tony M writes:

I was trying out the .jar version of the program in text mode, and I
notice that some of the commands are the same as or close to winboard
commands. Have you thought about adding Winboard (or UCI) support?


I have thought about adding UCI support, but haven't gotten around to it
yet. (With the "polyglot" UCI-winboard adapter, this would also make it
possible to use the engine with xboard/winboard.)


UCI-Support shouldn't be that difficult when you already have a move
parser. You need FEN-Parsing (easy), and integrate the UCI commands into
your already existing CLI.

It makes testing your program so much easier.

And here I misentered a move, but your program is winning easily. It
took nice advantage of pawn weaknesses.


I have added undo/redo buttons in my GUI, so if you misenter a move
there you can just undo and try again.


That reminds me on missing that in our xboard-interface during our final
contest at the end of the student project. No one was watching, I just
restarted. :-)

mfg, simon ....
  #7   Report Post  
Old January 9th 10, 11:50 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: May 2006
Posts: 155
Default new java chess program

Le 04/01/2010 08:06, Peter Osterlund a écrit :
Here is a java chess program that I have written:

http://web.telia.com/~u89404340/javachess/index.html

Its main feature is that it is not extremely strong, so you should
actually be able to beat it if you manage to avoid tactical errors.


Nice to see a chess engine in Java (there are too few of them).
Would it be possible to have extra information in the thinking line like
the number of nodes per second ?

Pascal Georges
  #8   Report Post  
Old January 10th 10, 11:04 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Sep 2007
Posts: 184
Default new java chess program

Simon Krahnke writes:

* Peter Osterlund (19:54) schrieb:

Tony M writes:

I was trying out the .jar version of the program in text mode, and I
notice that some of the commands are the same as or close to winboard
commands. Have you thought about adding Winboard (or UCI) support?


I have thought about adding UCI support, but haven't gotten around to it
yet. (With the "polyglot" UCI-winboard adapter, this would also make it
possible to use the engine with xboard/winboard.)


UCI-Support shouldn't be that difficult when you already have a move
parser. You need FEN-Parsing (easy), and integrate the UCI commands into
your already existing CLI.

It makes testing your program so much easier.


UCI support has now been implemented in the program. UCI move parsing is
trivial and I already had FEN parsing in my program. However, it still
required some non-trivial amount of work to implement pondering, the
"stop" and the "info" commands.

I have tested with xboard+polyglot and with Arena, and both appear to
work just fine with my engine. However, I haven't been able to make the
engine work with Rybka 3 Aquarium. It looks like Aquarium needs an exe
file. The same bat file trick that worked for Arena didn't work for
Aquarium. Maybe it would be possible to get it to work in Aquarium by
coding a small exe program that starts the java program.

I don't have any other chess GUIs so I don't know if other programs can
work with a java UCI engine.

--
Peter Osterlund -
http://web.telia.com/~u89404340
  #9   Report Post  
Old January 10th 10, 11:06 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Sep 2007
Posts: 184
Default new java chess program

Pascal writes:

Le 04/01/2010 08:06, Peter Osterlund a écrit :
Here is a java chess program that I have written:

http://web.telia.com/~u89404340/javachess/index.html

Its main feature is that it is not extremely strong, so you should
actually be able to beat it if you manage to avoid tactical errors.


Nice to see a chess engine in Java (there are too few of them).
Would it be possible to have extra information in the thinking line
like the number of nodes per second ?


Yes, that was actually quite easy to implement, since most of the work
had to be done anyway to implement the UCI "info" command.

--
Peter Osterlund -
http://web.telia.com/~u89404340
  #10   Report Post  
Old January 11th 10, 08:31 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default new java chess program

* Peter Osterlund (00:04) schrieb:

I have tested with xboard+polyglot and with Arena, and both appear to
work just fine with my engine. However, I haven't been able to make the
engine work with Rybka 3 Aquarium. It looks like Aquarium needs an exe
file. The same bat file trick that worked for Arena didn't work for
Aquarium. Maybe it would be possible to get it to work in Aquarium by
coding a small exe program that starts the java program.


I just found Jar2Exe at RegExLab.com, which embeds a jar file into an
exe using JNI. I just tried it with your program, works fine in Arena
and Shredder 6 classic.

mfg, simon .... l
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 April 23rd 06 05:21 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 February 19th 06 05:44 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 January 19th 06 06:15 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 November 18th 05 05:36 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 November 3rd 05 05:30 AM


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017