I have written a new chess program and have released the C++ source under a Creative Commons license. The name of the program is "Myopic" (I. e.; "short-sighted") and it has been designed for the Arduino Mega microcontroller platform (128 KB ROM / 8 KB RAM). The program is written entirely in ANSI C++ and will run not only on an Arduino Mega, but also under Mac OS/X or Linux.
The code still needs some work, particularly with positional evaluation.
See: http://public.me.com/chessnotation (directory: myopic)
-------
I've been battling some health issues recently, so I haven't produced much chess-wise. But I have set up a Facebook account; my fellow authors and enthusiasts are welcome to join as a friend:
http://www.facebook.com/profile.php?id=100001111380541
Myopic, a new Creative Commons chess program
Moderators: hgm, Rebel, chrisw
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Myopic, a new Creative Commons chess program
Here is a version that compiles and runs under Windows:sje wrote:I have written a new chess program and have released the C++ source under a Creative Commons license. The name of the program is "Myopic" (I. e.; "short-sighted") and it has been designed for the Arduino Mega microcontroller platform (128 KB ROM / 8 KB RAM). The program is written entirely in ANSI C++ and will run not only on an Arduino Mega, but also under Mac OS/X or Linux.
The code still needs some work, particularly with positional evaluation.
See: http://public.me.com/chessnotation (directory: myopic)
-------
I've been battling some health issues recently, so I haven't produced much chess-wise. But I have set up a Facebook account; my fellow authors and enthusiasts are welcome to join as a friend:
http://www.facebook.com/profile.php?id=100001111380541
http://cap.connx.com/chess-engines/new- ... /myopic.7z
Note: a 64 bit binary is included along with the few changes to the source that were needed.
P.S.
Since it is neither a UCI nor Winboard engines, work will be needed to make it play under a familiar GUI.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Myopic, a new Creative Commons chess program
Thanks, Dann. I don't have a Windows development environment; I hope you didn't have to make too many changes.
The Arduino Mega version and the desktop version of Myopic are pretty much the same except that the desktop version has a built-in PGN scanner and book compiler.
The Arduino Mega version and the desktop version of Myopic are pretty much the same except that the desktop version has a built-in PGN scanner and book compiler.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Sample output
Myopic uses a simple serial text interface. (It can also use a truly nifty 8x8 color LED matrix board display from SparkFun Electronics when operating on the Arduino Mega.)
Here's a sample transcript:
Here's a sample transcript:
Code: Select all
Myopic v2010.03.02 beta: A simple chess program for small systems
Copyright (C) 2010 by chessnotation@me.com Some rights reserved.
License: Creative Commons Attribution-Share Alike 3.0
See: http://creativecommons.org/licenses/by-sa/3.0/
Caution: No warranty; use at your own risk.
Enter 'hm' for help, 'qp' to quit.
[] hm
Commands:
bb Build book <input-game-file> <output-code-file>
db Display board
df Display FEN
dh Display position hash
dl Display opening library moves
dm Display moves
do Display options
ds Display status
em Enumerate movepaths to depth <n> plies
fm Fast enumerate movepaths to depth <n> plies
fp Flip position
gg Go and play to end of game
gp Go and play
gs Go search
hm Help me
id Show program identification
ng New game
pt Program test
qp Quit program
ro Reset option(s) (limit 7)
rp Reset program
sd Set depth limit to <n> plies
sf Set FEN
so Set option(s) (limit 7)
st Set time limit to <n> seconds
tb Take back move
Options:
aa Audible alert on move reply
cb Auto display chessboard
ct Trace command processing time
cv Trace current variation
if Trace input FEN
ip Trace input parameters
it Trace iteration announcements
nl No opening library book
nr No auto move reply
ps Trace preliminary scoring
pv Trace predicted variation updates
pz Trace ply zero move activity
rb Rotate board display (White at top)
sr Trace search result
st Trace search termination
ts Trace timing statistics
Moves:
Enter one or move moves (limit 8); use 'dm' command for list.
[] ds
a b c d e f g h
8 bRbNbBbQbKbBbNbR 8
7 bPbPbPbPbPbPbPbP 7
6 :: :: :: :: 6
5 :: :: :: :: 5
4 :: :: :: :: 4
3 :: :: :: :: 3
2 wPwPwPwPwPwPwPwP 2
1 wRwNwBwQwKwBwNwR 1
a b c d e f g h
[w KQkq - 0 1]
Moves: Na3 Nc3 Nf3 Nh3 a3 a4 b3 b4 c3 c4 d3 d4 e3 e4 f3 f4 g3 g4 h3 h4
Time limit: 5.000 Depth limit: 20
Options:
FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Hash: 9bbf11d452f40f1e
[] e4 e5 Nf3
Your move: 1 e4
Your move: 1... e5
Your move: 2 Nf3
My move: 2... Nc6
[] so ct it pv sr st ts
[ct] Seconds: 0.000
[] ds
a b c d e f g h
8 bR::bBbQbKbBbNbR 8
7 bPbPbPbP::bPbPbP 7
6 ::bN:: :: :: 6
5 :: :: bP :: 5
4 :: ::wP:: :: 4
3 :: :: ::wN:: 3
2 wPwPwPwP wPwPwP 2
1 wRwNwBwQwKwB::wR 1
a b c d e f g h
[w KQkq - 2 3]
Moves: Ba6 Bb5 Bc4 Bd3 Be2 Ke2 Na3 Nc3 Nd4 Ng1 Ng5 Nh4 Nxe5 Qe2 Rg1 a3 a4 b3 b4 c3 c4 d3 d4 g3 g4 h3 h4
Time limit: 5.000 Depth limit: 20
Options: ct it pv sr st ts
FEN: r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3
Hash: 635bee94c255f58c
[ct] Seconds: 0.000
[] so nl
[ct] Seconds: 0.000
[] gs
[it] Iteration: 1
[pv] PV: 3 Nc3 Score: +0.34
[it] Iteration: 2
[pv] PV: 3 Nc3 d6 Score: +0.10
[it] Iteration: 3
[pv] PV: 3 Nc3 d6 4 d3 Score: +0.34
[pv] PV: 3 d4 d6 4 d5 Score: +0.39
[it] Iteration: 4
[pv] PV: 3 d4 exd4 4 Nxd4 d5 Score: +0.22
[it] Iteration: 5
[pv] PV: 3 d4 exd4 4 Nxd4 d5 5 Nc3 dxe4 6 Nxc6 Score: +0.39
[pv] PV: 3 Nc3 Bc5 4 Bb5 Nge7 5 d3 Score: +0.40
[it] Iteration: 6
[pv] PV: 3 Nc3 Nf6 4 d4 Bb4 5 dxe5 Nxe4 Score: +0.48
[it] Iteration: 7
[pv] PV: 3 Nc3 Nf6 4 d4 exd4 5 Nxd4 Bb4 6 f3 Score: +0.43
[it] Iteration: 8
[st] Time limit reached
[sr] PV: 3 Nc3 Nf6 4 d4 exd4 5 Nxd4 Bb4 6 f3 Score: +0.43
[ts] Nodes: 3342336 Seconds: 5.085 Frequency: 657293 Hz
Move: 3 Nc3
[ct] Seconds: 5.086
[] dl
3 Bb5 (158/255)
3 Bc4 (49/255)
3 Nc3 (16/255)
3 c3 (4/255)
3 d4 (28/255)
[ct] Seconds: 0.000
[] qp
[ct] Seconds: 0.000
Done
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Relative timing
First, let me publicly give credit to Tom Boyle who provided very helpful beta testing of Myopic in the Arduino environment.
Second, for those interested in Arduino programming, see:
http://www.arduino.cc/
Third, for those interested in connecting a cool 8x8 color LED display via SPI to a microcontroller, see:
http://www.sparkfun.com/commerce/produc ... cts_id=760
Fourth, some perft movepath enumeration numbers for Myopic;
On a 2.66 GHz Xeon:
And then on a 16 MHz Arduino Mega:
The difference? About a factor of 1,700 slower for the Arduino. I suspect that the reason for much of this, other than the clock speed, is that the Arduino GCC C++ target environment is forcing all eight bit operations to 16 bits and back again.
Second, for those interested in Arduino programming, see:
http://www.arduino.cc/
Third, for those interested in connecting a cool 8x8 color LED display via SPI to a microcontroller, see:
http://www.sparkfun.com/commerce/produc ... cts_id=760
Fourth, some perft movepath enumeration numbers for Myopic;
On a 2.66 GHz Xeon:
Code: Select all
[] fm 0
[ts] Nodes: 1 Seconds: 0.000
Nodes: 1
[] fm 1
[ts] Nodes: 20 Seconds: 0.001 Frequency: 20000 Hz
Nodes: 20
[] fm 2
[ts] Nodes: 400 Seconds: 0.000
Nodes: 400
[] fm 3
[ts] Nodes: 8902 Seconds: 0.000
Nodes: 8902
[] fm 4
[ts] Nodes: 197281 Seconds: 0.009 Frequency: 21920111 Hz
Nodes: 197281
[] fm 5
[ts] Nodes: 4865609 Seconds: 0.211 Frequency: 23059758 Hz
Nodes: 4865609
[] fm 6
[ts] Nodes: 119060324 Seconds: 5.063 Frequency: 23515766 Hz
Nodes: 119060324
[] fm 7
[ts] Nodes: 3195901860 Seconds: 136.802 Frequency: 23361514 Hz
Nodes: 3195901860
[] fm 8
[ts] Nodes: 84998978956 Seconds: 3527.022 Frequency: 24099361 Hz
Nodes: 84998978956
Code: Select all
[] fm 0
[ts] Nodes: 1 Seconds: 0.002 Frequency: 499 Hz
Nodes: 1
[] fm 1
[ts] Nodes: 20 Seconds: 0.028 Frequency: 714 Hz
Nodes: 20
[] fm 2
[ts] Nodes: 400 Seconds: 0.049 Frequency: 8163 Hz
Nodes: 400
[] fm 3
[ts] Nodes: 8902 Seconds: 0.687 Frequency: 12957 Hz
Nodes: 8902
[] fm 4
[ts] Nodes: 197281 Seconds: 16.256 Frequency: 12135 Hz
Nodes: 197281
[] fm 5
[ts] Nodes: 4865609 Seconds: 356.699 Frequency: 13640 Hz
Nodes: 4865609
-
- Posts: 1342
- Joined: Wed Mar 08, 2006 9:41 pm
- Location: Morgantown, WV, USA
Re: Myopic, a new Creative Commons chess program
Hope you feel better.sje wrote: I've been battling some health issues recently, so I haven't produced much chess-wise. But I have set up a Facebook account; my fellow authors and enthusiasts are welcome to join as a friend:
http://www.facebook.com/profile.php?id=100001111380541
-Josh
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Myopic, a new Creative Commons chess program
The changes were trivial. Took me less than 10 minutes. I did introduce a few tag names so that doxygen would draw pretty pictures for me.sje wrote:Thanks, Dann. I don't have a Windows development environment; I hope you didn't have to make too many changes.
The Arduino Mega version and the desktop version of Myopic are pretty much the same except that the desktop version has a built-in PGN scanner and book compiler.
I may write an xboard interface for it if someone else doesn't beat me to it.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Myopic, a new Creative Commons chess program
Thanks. I had a big decline some months ago about the time I was writing Myopic's positional evaluator have haven't yet been back coding. Now I'm having some difficulty just with walking, but maybe the upcoming cardiologist visit will offer some hope.jshriver wrote:Hope you feel better.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Myopic, a new Creative Commons chess program
TEN MINUTES? Hell, at this point it would take me more like ten hours to make any improvements, and it was me who wrote the damn thing.Dann Corbit wrote:The changes were trivial. Took me less than 10 minutes. I did introduce a few tag names so that doxygen would draw pretty pictures for me.sje wrote:Thanks, Dann. I don't have a Windows development environment; I hope you didn't have to make too many changes.
The Arduino Mega version and the desktop version of Myopic are pretty much the same except that the desktop version has a built-in PGN scanner and book compiler.
I may write an xboard interface for it if someone else doesn't beat me to it.
For those who might try their own modifications, you might want to know that Myopic uses target bitboards (class: TBV). These are like chessboard bitboards, but each one is only 32 bits long with one bit per each possible piece. There is also a 64 element square-to-target vector and its inverse, a 32 element target-to-square vector.
There's some other stuff in there that I thought was pretty good but I can't remember exactly what.
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Myopic, a new Creative Commons chess program
My wife is in a simlar sore strait. She has an enlarged heart, heart rhythm problems, diabetes, neuropathy, and various other ailments.sje wrote:Thanks. I had a big decline some months ago about the time I was writing Myopic's positional evaluator have haven't yet been back coding. Now I'm having some difficulty just with walking, but maybe the upcoming cardiologist visit will offer some hope.jshriver wrote:Hope you feel better.
I do realize that it can make the simplest operations of every day life very difficult.
I hope that you can regain some measure of your health, and I would also like to thank you for your large measure of contributions to the chess community.