hachu.git
10 years agoFix setting oldBest
H.G. Muller [Sat, 1 Jun 2013 21:03:20 +0000]
Fix setting oldBest

10 years agoFix layout
H.G. Muller [Sat, 1 Jun 2013 21:00:40 +0000]
Fix layout

10 years agoFix clearing of ponder move
H.G. Muller [Sat, 1 Jun 2013 20:58:32 +0000]
Fix clearing of ponder move

10 years agoFix move list
H.G. Muller [Sat, 1 Jun 2013 20:55:37 +0000]
Fix move list

10 years agoCall SetSearchTimes
H.G. Muller [Sat, 1 Jun 2013 20:53:12 +0000]
Call SetSearchTimes

10 years agoFix reply depth
H.G. Muller [Sat, 1 Jun 2013 20:43:36 +0000]
Fix reply depth

10 years agoFix clearing input buffer
H.G. Muller [Sat, 1 Jun 2013 08:27:49 +0000]
Fix clearing input buffer

10 years agoImplement pondering on position / analysis
H.G. Muller [Sat, 1 Jun 2013 08:07:21 +0000]
Implement pondering on position / analysis

Pondering is indicated by setting abortFlag to -1. This suppresses testing
on time, both in TerminalCheck() and at the end of an iteration.

10 years agoAdd routine to check for input
H.G. Muller [Sat, 1 Jun 2013 06:00:36 +0000]
Add routine to check for input

10 years agoImplement abort of search on long thinking time
H.G. Muller [Sat, 1 Jun 2013 05:56:21 +0000]
Implement abort of search on long thinking time

A global variable abortFlag is tested to make the search unwind. A function
TerminalCheck() is added to read the clock and set this variable if needed,
based on the tlim3 time limit. Measures have been taken to make sure the
root node returns a valid move and score even when interrupted during the
search of the first move.

10 years agoSplit calculating of time limits from SearchBestMove
H.G. Muller [Fri, 31 May 2013 22:06:48 +0000]
Split calculating of time limits from SearchBestMove

Make the TC parameters global so they would not have to be passed to
the new SetTimeLimits() via SearchBestMove(), and SetTimeLimits()
can be called also from within search.

10 years agoMove input and procesing time, otim to separate routine
H.G. Muller [Fri, 31 May 2013 19:48:45 +0000]
Move input and procesing time, otim to separate routine

Reading the input line and treating some commands is moved to a separate
routine, so it can also be called during ponder search. The commands
needed to be treated in ponder without interrupting it are time and otim
(to get to the following usermove to determine hit-or-miss). The commands
lift and put also must be satisfiable without aborting a ponder search.
(Because Highlight now uses a prepared move list this is possible.)

10 years agoLeave move list of game position on stack permanently
H.G. Muller [Fri, 31 May 2013 17:50:12 +0000]
Leave move list of game position on stack permanently

The move list that was temporarily created for ParseMove and Highlight
is now kept permanently on the stack (by setting msp to the end of it
after it is created). ParseMove and Highlight thus no longer have to
generate it, and generation is moved to the top of the main loop, and
only done when the list does not exist yet. The list is discarded as soon
as we execute a command that changes the game position.

10 years agoReorder parsing of protocol commands
H.G. Muller [Fri, 31 May 2013 17:41:02 +0000]
Reorder parsing of protocol commands

All commands that change the position are put at the end.

10 years agoBuild move list of game position for general use
H.G. Muller [Fri, 31 May 2013 17:27:30 +0000]
Build move list of game position for general use

Both ParseMove and Highlight needed a move list, and geerated it on the fly.
This shared code has been moved to a separate routine. New variables
listStart and listEnd point out this list on the move stack, as replaement
for the more volatile retMSP and retFirst.

10 years agoImplement null move
H.G. Muller [Mon, 27 May 2013 20:54:24 +0000]
Implement null move

10 years agoImplement killers
H.G. Muller [Mon, 27 May 2013 20:46:34 +0000]
Implement killers

10 years agoImplement hash table
H.G. Muller [Mon, 27 May 2013 20:24:29 +0000]
Implement hash table

10 years agoFix buf in position setup without Elephant/Prince
H.G. Muller [Fri, 26 Apr 2013 08:38:48 +0000]
Fix buf in position setup without Elephant/Prince

HaChu's check test assumes the piece after King in the piece list will be
Crown Prince. When positions without CP or DE (which causes addition of
a CP for promotion, marked as ABSENT) were loaded, this would not be the
case, and the presence of another piece could create the illusion of
immunity to check. In Chess / Shatranj / Makruk a dummy (ABSENT) CP was
added to prevent this, but the problem occurred just as much in set-up
positions of true Shogi variants. Now we always add a dummy CP if the
loaded position did not cause adding it already.

10 years agoImplement Makruk
H.G. Muller [Sun, 21 Apr 2013 19:43:27 +0000]
Implement Makruk

Internally the Met is written as SM, because that corresponds to the
WinBoard 'M' in Chu. The promotion character had to be adapted to 'm'.
For Chess and Shatranj a '+' was still wrongly used, and this was fixed
to 'q'. On input any suffix character that is not an '=' will be interpreted
as '+'.

10 years agoFix setboard command
H.G. Muller [Sat, 2 Mar 2013 21:35:27 +0000]
Fix setboard command

The variant was not correctly identivied, by using its code rather than
its number when calling Init. The test for Knight when converting WB FEN
to internal position string did not work, so N was converted to Lion.
As Q is converted to :FK, the Ferz in Shatranj was renamed to FK.

10 years agoMake repetitions in Chess and Shatranj draws
H.G. Muller [Sun, 24 Feb 2013 11:20:05 +0000]
Make repetitions in Chess and Shatranj draws

10 years agoGive King neutral PST
H.G. Muller [Sun, 24 Feb 2013 11:09:59 +0000]
Give King neutral PST

The King was drawn to the center like any general...

10 years agoFix Shatranj
H.G. Muller [Sun, 24 Feb 2013 11:08:37 +0000]
Fix Shatranj

10 years agoFix crash in double-push, and make it subject to chessFlag
H.G. Muller [Sun, 24 Feb 2013 10:47:08 +0000]
Fix crash in double-push, and make it subject to chessFlag

Passed squares in NewNonCapt are used as array index, and should not
be mutilated with flags! As the M (=non-capt only) move type is now
also used in Shatranj, make the double-push subject to a new chessFlag.

10 years agoImplement Shatranj
H.G. Muller [Sun, 24 Feb 2013 10:15:45 +0000]
Implement Shatranj

Although Shatranj is not a Shogi variant, it is much more Shogi-like than
Chess. The only thing that makes it different is the divergent move of
the Pawn.

11 years agoVersion 0.4beta
H.G. Muller [Sat, 19 Jan 2013 16:43:04 +0000]
Version 0.4beta

11 years agoAdd debug printf in ParseMove
H.G. Muller [Sat, 19 Jan 2013 16:41:03 +0000]
Add debug printf in ParseMove

11 years agoMake debug output less verbose
H.G. Muller [Sat, 19 Jan 2013 16:39:00 +0000]
Make debug output less verbose

The board does not need to be printed after every command; just when it
starts thinking or playing an entered move. The move list needs never be
printed, as Search already does that in both cases.

11 years agoFix crash after using setboard (and undo?)
H.G. Muller [Sat, 19 Jan 2013 16:34:04 +0000]
Fix crash after using setboard (and undo?)

The crash was due to an attempt to set up a Lance in Chess. An error message
has been added to detect unknown pieces in setup. Also the ambiguity of N
in FEN between Chess and Chu has been resolved in Convert. The board is
now cleared before calling Setup, by calling Init.

11 years agoImplement sd command
H.G. Muller [Fri, 18 Jan 2013 16:29:17 +0000]
Implement sd command

Also increment maximum game length (which was only 500 ply).

11 years agoImplement setboard command
H.G. Muller [Fri, 18 Jan 2013 16:26:39 +0000]
Implement setboard command
Allow it to read regular 1-char FEN as well as internal 2-letter format.
Implement promoted pieces in the latter.

11 years agoImprove time management
H.G. Muller [Fri, 18 Jan 2013 16:20:39 +0000]
Improve time management

11 years agoGive reason when Lion captures are rejected as illegal
H.G. Muller [Fri, 18 Jan 2013 16:18:40 +0000]
Give reason when Lion captures are rejected as illegal

11 years agoPrint static eval with thinking output
H.G. Muller [Fri, 18 Jan 2013 16:15:50 +0000]
Print static eval with thinking output

Also compute difEval from scratch, for error checking.

11 years agoFix eval sign bug in (not-yet-used) null move
H.G. Muller [Fri, 18 Jan 2013 16:08:44 +0000]
Fix eval sign bug in (not-yet-used) null move

11 years agoTake somewhat more spacing for move sorting
H.G. Muller [Fri, 18 Jan 2013 16:07:14 +0000]
Take somewhat more spacing for move sorting

The gaps in the move stack are now 50 in stead of 20.

11 years agoFix bug in move sorting
H.G. Muller [Fri, 18 Jan 2013 16:05:30 +0000]
Fix bug in move sorting

Due to reverse comparison, oves were resorted on every iteration into the
static order, completely thwarting the purpose of (I)ID.

11 years agoFix bug in PST initialization
H.G. Muller [Fri, 18 Jan 2013 16:02:17 +0000]
Fix bug in PST initialization

The null table was not explicitly initialized, and was contaminated by
earlier initialization with another board size.

11 years agoFix move bug for oce and for all
H.G. Muller [Fri, 18 Jan 2013 15:01:40 +0000]
Fix move bug for oce and for all

Also Falcons and Eagles captured like Knight if victim attacked by Lion.

11 years agoClaim win against illegal move if opponent is computer
H.G. Muller [Fri, 18 Jan 2013 14:59:18 +0000]
Claim win against illegal move if opponent is computer

Otherwise the game would hang in Two Machines mode, which is very undesirable
if the opponent is a connection adapter to a server.

11 years agoGive reason with Illegal move message in case of repeat
H.G. Muller [Fri, 18 Jan 2013 14:55:41 +0000]
Give reason with Illegal move message in case of repeat

11 years agoImprove potential debug print
H.G. Muller [Fri, 18 Jan 2013 14:05:20 +0000]
Improve potential debug print

11 years agoMake sure King-capture move is printed
H.G. Muller [Fri, 18 Jan 2013 14:04:41 +0000]
Make sure King-capture move is printed

11 years agoFix bug in Phoenix captures
H.G. Muller [Fri, 18 Jan 2013 14:02:55 +0000]
Fix bug in Phoenix captures

Jumping pieces would capture as Knight when the victim was also attacked
b a Lion.

11 years agoAdd Tenjiku and other variants
H.G. Muller [Fri, 18 Jan 2013 14:00:36 +0000]
Add Tenjiku and other variants

11 years agoAdd Chess pieces
H.G. Muller [Thu, 12 Jul 2012 10:11:31 +0000]
Add Chess pieces

11 years agoSome work on incremental attack-map update
H.G. Muller [Thu, 12 Jul 2012 10:07:57 +0000]
Some work on incremental attack-map update

11 years agoAdd mobility eval
H.G. Muller [Thu, 12 Jul 2012 10:05:59 +0000]
Add mobility eval

Count moves during construction of atack map. The mobility weight is
based on the base value of the piece.

11 years agoBeter tuning of time control
H.G. Muller [Thu, 12 Jul 2012 10:02:36 +0000]
Beter tuning of time control

Reduce target time, and keep a larger safety margin.

11 years agoDelete some disabled code
H.G. Muller [Thu, 12 Jul 2012 10:00:52 +0000]
Delete some disabled code

11 years agoImplement Dai Shogi
H.G. Muller [Mon, 9 Jul 2012 15:12:37 +0000]
Implement Dai Shogi

The board format was made variable, and the relevant parameters are set
during Init() according to the current variant (now passed as parameter).
LookUp() now searches the requested piece in multiple lists, depending
on the current variant. E.g. for Dai it searches daiPieces, followed by
chuPieces. The WB variant command is now interpreted, by comparing
the mentioned variat to the list of variants. Support for plain Knight
moves was added. The suppression of promotions after an initial deferral
was made subject to chuFlag.

11 years agoVersion number 0.0
H.G. Muller [Fri, 6 Jul 2012 20:17:01 +0000]
Version number 0.0

Add the myname feature to print name + this version.

11 years agoSome work on incremental update of attack map
H.G. Muller [Fri, 6 Jul 2012 20:15:08 +0000]
Some work on incremental update of attack map

11 years agoRecognize 'result' command in WB driver
H.G. Muller [Fri, 6 Jul 2012 07:45:41 +0000]
Recognize 'result' command in WB driver

Currently a no-op, but just to suppress Unknown Command errors.

11 years agoImplement printing of WB thinking output
H.G. Muller [Fri, 6 Jul 2012 07:43:15 +0000]
Implement printing of WB thinking output

11 years agoAdd null move
H.G. Muller [Fri, 6 Jul 2012 07:38:26 +0000]
Add null move

The WB Alien null-move notation is recognized on input, and generated
on output. The internal representation is a move towards the same square
by a piece that has this capability. (This currently fails on a1, due
to 0 being used as representation for invalid moves!)
Only one null move is generated and added to the move list.
The null move is not searched yet.

11 years agoImplement repetition detection
H.G. Muller [Thu, 5 Jul 2012 21:45:15 +0000]
Implement repetition detection

A linear search through repStack, containing the hash keys, is used
to detect repetitions and declare them lost. Repetitions can already
start two ply ago, due to turn passing. A reversible move counter
is added for the purpose, and saved in the UndoInfo.

11 years agoGive pieces of same type same Zobrist key
H.G. Muller [Thu, 5 Jul 2012 21:39:00 +0000]
Give pieces of same type same Zobrist key

Give different piece keys to white and black pieces of same type. Switch
to a system that assigns the key 'on demand', when the entry in the
list of piece descriptions is first used. Let Lookup return pointer
rather than number in list, so that future versions can search in multiple
lists (for other variants).

11 years agoKeep track of PV
H.G. Muller [Thu, 5 Jul 2012 21:29:57 +0000]
Keep track of PV

Use the triangular-array method (Fairy-Max style) to keep track of the PV.

11 years agoPass difEval on to root search
H.G. Muller [Thu, 5 Jul 2012 21:20:04 +0000]
Pass difEval on to root search

Upto now all searches started at 0.

11 years agoAdd some debug prints
H.G. Muller [Thu, 5 Jul 2012 21:13:26 +0000]
Add some debug prints

11 years agoSave hash key in UndoInfo
H.G. Muller [Thu, 5 Jul 2012 21:04:39 +0000]
Save hash key in UndoInfo

This to make it possible for the MakeMove and UnMake to update it
at game level during the ponder search.

11 years agoFix alpha bug, promotion bug, highlighting and move printing bugs
H.G. Muller [Thu, 5 Jul 2012 20:52:48 +0000]
Fix alpha bug, promotion bug, highlighting and move printing bugs

Two crippling bugs fixed: alpha was not  reset at the start of later
iterations, and promotions were added to the move-list of deeper nodes
due to spoiling of the global nonCapts.
Essential deferrals were not correctly flagged on input moves.
Printing move lists could miss some initial moves, wrecking highlighting.

11 years agoAdd time control
H.G. Muller [Thu, 5 Jul 2012 20:36:49 +0000]
Add time control

A simple time control, finishing iterations, is added. Also a node counter.

11 years agoFix signals for Linux, input-buffer overrun
H.G. Muller [Thu, 5 Jul 2012 19:53:37 +0000]
Fix signals for Linux, input-buffer overrun

11 years agoMore developed version for WinBoard Alien Edition
H.G. Muller [Tue, 3 Jul 2012 13:00:23 +0000]
More developed version for WinBoard Alien Edition

This commit contains the code as it was further developed on Windows,
and tested under WB-Alien. Highlighting was added, and a 3-ply fixed-depth
search is invoked when it is the engines turn to move. Piece-square tables
have been added to draw pieces to the center, and the move generator respects
the special Lion-capture and promotion rules of Chu Shogi. Most of the time
things work, but there must be a bad bug, as sometimes it suddenly moves
with an opponent piece!

11 years agoInitial commit of Linux code
H.G. Muller [Tue, 3 Jul 2012 12:54:54 +0000]
Initial commit of Linux code

This embrionic code was developed on Linux. The move generator is
sort of working, but the multi-move feature is barely tested, because
the standard XBoard does not support that.