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

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

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 7:34 pm
Location: Scotland
Contact:

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

Post by Christopher Conkie » Mon Sep 07, 2009 6:44 pm


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

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

Post by Graham Banks » Mon Sep 07, 2009 6:53 pm

I thought that you didn't like derivatives. :wink:
gbanksnz at gmail.com

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

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

Post by Christopher Conkie » Mon Sep 07, 2009 7:06 pm

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: 34537
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

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

Post by Graham Banks » Mon Sep 07, 2009 7:09 pm

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 7:34 pm
Location: Scotland
Contact:

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

Post by Christopher Conkie » Mon Sep 07, 2009 7:13 pm

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: 34537
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

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

Post by Graham Banks » Mon Sep 07, 2009 7:19 pm

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: 6546
Joined: Thu Mar 09, 2006 3:21 am

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

Post by swami » Mon Sep 07, 2009 8:03 pm

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 7:34 pm
Location: Scotland
Contact:

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

Post by Christopher Conkie » Mon Sep 07, 2009 8:08 pm

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 7:34 pm
Location: Scotland
Contact:

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

Post by Christopher Conkie » Mon Sep 07, 2009 9:11 pm

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: 482
Joined: Wed Mar 08, 2006 8:45 pm
Location: Portland, OR
Contact:

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

Post by IanO » Tue Sep 08, 2009 3:14 pm

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

Post Reply