Go FORTH and multiply with FCP.......

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Go FORTH and multiply with FCP.......

Post by Christopher Conkie »

User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Go FORTH and multiply with FCP.......

Post by Graham Banks »

I thought that you didn't like derivatives. :wink:
gbanksnz at gmail.com
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: Go FORTH and multiply with FCP.......

Post by Christopher Conkie »

Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......

Code: Select all

\ FCP.F, version 1.2 by Ian Osgood  iano@xquirkster.com
\ A simple chess program written in ANS Forth.

\ Uses Core Extension words:
\   .( .R U.R <> U> ?DO ERASE FALSE NIP TO TRUE TUCK VALUE WITHIN \
\ Uses Exception words&#58; CATCH THROW ABORT"
\ Uses Tools Extension words&#58; &#91;IF&#93; &#91;ELSE&#93; &#91;THEN&#93;
\ Uses String words&#58;          TOLOWER /STRING
\ Uses Win32Forth utilities&#58;  ms@ CELL CELL- DEFER IS &#91;DEFINED&#93; &#91;UNDEFINED&#93;
\ Will use DEFER and IS if available for board iterator and vectors.
\ Uses defacto-standard HEX constant specifier&#58; $FF
\  &#40;I would use decimal #99, but it isn't supported by Win32Forth.
\   Thus, BASE 10 is assumed.  Use the next line if this is not the case.)
\ BASE @ DECIMAL
UNUSED

\ Assumes 32-bit cells
\ Recursive&#58; assumes a data stack larger than MAX_PLY
\  and a return stack larger than 3*MAX_PLY.
\ Uses about 64K bytes of dictionary space.  Some structures &#40;eval boards etc.)
\  could use signed chars instead of cells for some space savings.

\ For further commentary on the basic chess data structures and algorithms,
\  please refer to the C source of the original TSCP program &#40;v1.73&#41;,
\  written by Tom Kerrigan.
\  http&#58;//home.comcast.net/~tckerrigan/

\ Change log&#58;
\ &#40;Initial port from TSCP C program&#41;
\ 1* 0x88 vs. mailbox edge detection
\  * different piece & color values
\  * fine-grain factoring
\  * different command set, UI
\ 2* track king positions for inCheck?
\  * &#91;reps implemented&#93;
\ 3* material and pawn files updated incrementally for eval
\  * narrow starting a-b window with fail-high/low for more cutoffs
\  * setup EPD command
\ 4* style improvements based on c.l.f commentary
\  * fixed bugs in time display, reps
\  * use $ for hex constants instead of using DECIMAL & HEX
\  * .board options&#58; showCoords, rotateBoard
\  * .epd command for recording a position, .moveList to list moves
\ &#40;hiatus&#41;
\ 5* more factoring and commentary
\  * inLine? optimized &#40;thanks to Bruce Moreland's excellent web site&#41;
\    http&#58;//www.seanet.com/~brucemo/topics/0x88.htm
\  * bd@ inlined and made into CELLS for a large speedup!
\  * fixed bug in genPush to bring node counts in line with TSCP.EXE
\  * st command to set thinking time &#40;seconds per move&#41;
\  * replaced most VARIABLEs with VALUEs &#40;faster and more concise&#41;
\ 6* inline and tweak hottest words for 25% speed boost
\  * fix bugs in epd, reps
\  * more factoring&#58; move generation greatly simplified
\  * use new DEFER-based board iterators for move gen and eval
\ 7* inner loop unrolling
\  * optimize PV handling, eval, genPush
\  * remove forEachPiece/forEachOfMyPieces abstraction layer
\  * clarify word and variable names
\ 8* elegant stack machine alpha-beta search uses half the data stack
\  * fix some search and eval bugs &#40;fixes node count diffs&#41;
\  * more search debugging words &#40;uses FILE wordset&#41;
\  * fcp-help command
\ 9* further optimized attacks?, eval, moveGen
\  * use CATCH/THROW to abort a search more simply
\ A* use &#58;inline from Wil Baden for inline words
\  * smaller, more effective history table
\  * killer moves, new sorting mechanism
\  * fix some MAX_PLY limit bugs, thanks to running test suites &#40;setup2&#41;
\  * move debug code to separate file &#40;available upon request&#41;
\  * check for king errors in setup, use ABORT" for input
\ &#40;Sufficiently enhanced to rename to FCP.)
\ 1.0 * null-move heuristic &#40;major tactical speedup!)
\     * better check search extension &#40;ditto!)
\ 1.1 * added an opening book &#40;extensions to fcp-book.f are welcome!)
\     * refactored input routines, ?research
\     * support for being an X/WinBoard engine &#40;quiet flag, onSearchStatus&#41;
\     * small eval tweaks
\     * new renamed to newGame; .bookHint, bookOff commands
\ 1.2 * minor bugfixes, king opposition fixed, some more refactoring

\ Possible future enhancements&#58;
\ + experiment with other search extensions&#58;
    \ single response, null-move mated, recapture, passed pawn advance
\ + add a transposition table
\ + keep piece lists to avoid board iteration
\ + further optimize eval routines
\ + clean up input routines
\ + update squares attacked incrementally
\ + enhance evaluation routines
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Go FORTH and multiply with FCP.......

Post by Graham Banks »

Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
gbanksnz at gmail.com
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: Go FORTH and multiply with FCP.......

Post by Christopher Conkie »

Graham Banks wrote:
Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
Yes....ORIGINALLY. Can you see the GNU Public Licence?

I can't.......so he must feel confident it's not required......

I can believe that from looking at it.

Christopher
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Go FORTH and multiply with FCP.......

Post by Graham Banks »

Christopher Conkie wrote:
Graham Banks wrote:
Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
Yes....ORIGINALLY. Can you see the GNU Public Licence?

I can't.......so he must feel confident it's not required......

I can believe that from looking at it.

Christopher
Fair enough. I'm no expert on such things. 8-)
gbanksnz at gmail.com
swami
Posts: 6640
Joined: Thu Mar 09, 2006 4:21 am

Re: Go FORTH and multiply with FCP.......

Post by swami »

Christopher Conkie wrote:
Graham Banks wrote:
Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
Yes....ORIGINALLY. Can you see the GNU Public Licence?

I can't.......so he must feel confident it's not required......

I can believe that from looking at it.

Christopher
Downloaded this file
"win32forth-stc-V00205.zip"

I see "GPL.txt" and "LGPL.txt" in there.
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: Go FORTH and multiply with FCP.......

Post by Christopher Conkie »

swami wrote:
Christopher Conkie wrote:
Graham Banks wrote:
Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
Yes....ORIGINALLY. Can you see the GNU Public Licence?

I can't.......so he must feel confident it's not required......

I can believe that from looking at it.

Christopher
Downloaded this file
"win32forth-stc-V00205.zip"

I see "GPL.txt" and "LGPL.txt" in there.
Win2Forth is a Windows Forth IDE and a compiler with which you can compile the source of FCP.

FCP is made in Forth, you can compile it with Win2Forth.
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: Go FORTH and multiply with FCP.......

Post by Christopher Conkie »

Christopher Conkie wrote:
swami wrote:
Christopher Conkie wrote:
Graham Banks wrote:
Christopher Conkie wrote:
Graham Banks wrote:I thought that you didn't like derivatives. :wink:
LOL....number changing this is not......
Okay - I was just going by the author's own statement:
Ian Osgood's Forth Chess Program (FCP)

Here is a chess program originally derived from Tom Kerrigan's simple chess program TSCP.
Yes....ORIGINALLY. Can you see the GNU Public Licence?

I can't.......so he must feel confident it's not required......

I can believe that from looking at it.

Christopher
Downloaded this file
"win32forth-stc-V00205.zip"

I see "GPL.txt" and "LGPL.txt" in there.
Win2Forth is a Windows Forth IDE and a compiler with which you can compile the source of FCP.

FCP is made in Forth, you can compile it with Win2Forth.
Win32Forth even. Must get the "3" fixed on this keyboard;

A more soothing site is this one....

http://home.wxs.nl/~josv/

:D
IanO
Posts: 496
Joined: Wed Mar 08, 2006 9:45 pm
Location: Portland, OR

Re: Go FORTH and multiply with FCP.......

Post by IanO »

Christopher Conkie wrote:http://www.quirkster.com/forth/FCP.html

You will be needing this.......

http://sourceforge.net/projects/win32forth/files/

Very nice.

:-)

Christopher
Glad you like it. It will also work with most other ANS Forths, like GNU Forth and the compiled bigForth. It was my first Forth program and first full chess program. Although it is in a different language, uses 0x88 board representation, and has many search extensions; it still has an evaluation that is nearly identical to TSCP 1.71. (This was on purpose, so I could more easily distinguish search and porting bugs as I learned Forth.) Tom Kerrighan has graciously allowed me to distribute this program without copyright.

There is another Forth chess program called brainless which is slightly stronger and not a derivative work. The source is harder to find, however.

Ian