Marco Costalba
6fb0a1bc40
Introduce distance() and unify some API
...
Original work by Lucas.
No functional change.
2014-11-09 10:27:04 +01:00
Marco Costalba
c6fc51c5ea
Fix a warning with MSVC in 'analyze' mode
...
Here MSVC is worried that
StepAttacksBB[PAWN][psq]
could overflow, so change psq initialization
to clarify psq is always less than 64.
No functional change.
2014-06-14 12:46:58 +02:00
Marco Costalba
fcf2a34080
Some more work in pretty_pv
...
No functional change.
2014-04-06 10:15:11 +02:00
Marco Costalba
5f12069cbf
Retire operator|(File f, Rank r)
...
Use make_square() instead. Less fancy but
more clear.
No functional change.
2014-03-22 23:54:18 +01:00
Marco Costalba
e4695f15bc
Additional renaming from DON
...
Assorted renaming and triviality.
No functional change.
2014-02-14 09:42:50 +01:00
Marco Costalba
a646f74e6a
Assorted grammar fixes
...
Mainly from Lyudmil Antonov and
one from Henri Wiechers and Louis Zulli.
No functional change.
2014-01-07 14:30:41 +09:00
Marco Costalba
c9dcda6ac4
Update copyright year
...
No functional change.
2014-01-02 01:49:18 +01:00
Arjun Temurnikar
190aea4cdc
Assorted spelling/grammar/captitalization
...
No functional change.
2013-12-04 23:30:37 +01:00
Jerry Donald
500b9b0eb3
Assorted spelling fixes
...
No functional change.
2013-12-02 18:41:30 +01:00
Lucas Braesch
7f142d6817
Use prefix operators wherever possible
...
No functional change.
2013-10-05 18:10:43 +02:00
Marco Costalba
3abccdc82d
Move classify_leaf() to c'tor in bitbases
...
No functional change.
2013-09-14 13:08:37 +02:00
Marco Costalba
8d6d0223bf
Small touches to bitbase.cpp
...
Inspired by Lucas's code:
https://github.com/lucasart/chess/blob/master/src/kpk.cc
No functional change.
2013-09-14 11:19:12 +02:00
Marco Costalba
4ede49cd85
Fully qualify memset and memcpy
...
And other trivial touches.
Ispired by Lucas's DiscoCheck
No functional change.
2013-07-13 18:01:13 +02:00
Marco Costalba
818a3537a7
Use Them instead of ~Us
...
Unortunatly we have no guarantee that the call to
operator~(Color c) is resolved at compile time.
Perhaps the solution would be to use C++11 const_expr,
but for now simply use the good old-style ternary operator
that works as expected.
No functional change.
2013-05-11 11:49:44 +02:00
Marco Costalba
077e32efc9
Better document bitbase loop
...
Thanks to Lucas to spot the weak comment and
to Jundery to suggest a better one.
No functional change.
2013-03-19 19:08:41 +01:00
Marco Costalba
c5ec94d0f1
Update copyright year
...
No functional change.
2013-02-19 07:54:14 +01:00
Marco Costalba
e0dfb0bc34
Further speed up bitbase generation
...
Another trick, along the same lines of previous
patch. This time we first check positions with
white side to move that, becuase we start with
pawn on rank 7, are easily classified as wins,
then black ones.
Number of cycles reduced to 15 !
Becuase now it is faster we can remove a lot of
code to detect theoretical draws. We will calculate
them anyhow, although a bit slower, but the speed
up trick more than compensates it.
Verified that generated bitbases match original ones.
No functional change.
2013-02-15 11:58:33 +01:00
Marco Costalba
10d29add18
Speedup KPK bitbase of 25%
...
Change the way the index is coded so that
now looping from 0 to IndexMax generates
the pawns from RANK_7 down to RANK2.
Becuase positions with pawns at RANK_7
are easily classified as wins/draws, this
small trick allows to reduce the number
of needed iterations from 30 down to 26!
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-02-13 20:13:56 +01:00
Marco Costalba
f2950ae206
Simplify bitbase.cpp
...
Use a std::vector to store positions and
rearrange KPKPosition.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-02-13 20:13:44 +01:00
Marco Costalba
faaa1f1116
Don't push on the stack 200KB in one go
...
This could be a limit on some platforms (as it seems
to be in Native Client). Patch from a SF fork on github:
47374afd6f
No functional change.
2012-09-30 11:35:14 +02:00
Marco Costalba
7c1f8dbde9
Introduce namespace Bitbases
...
Let's continue this namespace galore...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-08-18 13:08:12 +01:00
Marco Costalba
6b5322ce00
Rename first_1 / last_1 in lsb / msb
...
It seems more accurate: lsb is clear while 'first
bit' depends from where you look at the bitboard.
And fix compile in case of 64 bits platforms that
do not use BSFQ intrinsics.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-07-08 09:36:40 +01:00
Marco Costalba
5f5d056c8f
Replace make_square() with operator|(File, Rank)
...
Be fancy :-)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-06-23 09:17:54 +01:00
Marco Costalba
0ecc920a09
Add a known draw case in kpk bitbase generation
...
Early classify as known draws the positions
where white king is trapped on the rook file.
Suggested by Dan Honeycutt.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-05-19 08:45:16 +01:00
Marco Costalba
a94fd3bbec
Reformat kpk bitbase
...
Simplify and streamline the code. Verified all the
resulting bitbases are not changed.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-01-30 19:19:47 +01:00
Marco Costalba
a492a9dd07
Bitwise operator overloads between Bitboard and Square
...
Yes, we try to be fancy here ;-)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2012-01-29 10:59:50 +01:00
Marco Costalba
8307da0de7
Update copyright year to 2012
...
And refresh Readme.txt while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-12-30 13:52:16 +01:00
Marco Costalba
a695ed65a8
Rename Pieces
...
Align with PieceType naming convention and
make them more readable.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-12-28 10:38:48 +01:00
Marco Costalba
a44c5cf4f7
Prefer 0 to EmptyBoardBB
...
Easier and even faster or at least easier to optimize.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-12-03 12:02:13 +01:00
Marco Costalba
c2c185423b
Better naming borrowed from Critter
...
In line with http://chessprogramming.wikispaces.com conventions.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-10-02 10:16:59 +01:00
Marco Costalba
15683034a7
Speed up kpk initialization
...
The trick is to classify more position at first cycle,
so to reduce following work. Speed up is of about 50% !
Also some cleanup while there.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-06-15 12:11:35 +01:00
Marco Costalba
635be39acf
Additional cleanup in bitbase.cpp
...
Also better document what code does.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 18:22:22 +01:00
Marco Costalba
c1c0984452
Move KPKBitbase[] where it belongs
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 12:12:41 +01:00
Marco Costalba
d653aeca05
Fix a couple of issues in bitbase.cpp
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-12 11:22:02 +01:00
Marco Costalba
d9113d127b
Rename NonSlidingAttacksBB[] in StepAttacksBB[]
...
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-03-10 08:10:26 +01:00
Marco Costalba
0fcda095df
Move all enum types definitions to types.h
...
Cleanup headers while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-02-23 21:52:55 +01:00
Marco Costalba
be5b32bb9c
Another round of bitboard.cpp cleanups
...
Also renamed StepAttackBB[] in NonSlidingAttacksBB[]
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-01-04 11:12:31 +01:00
Marco Costalba
469e7c5143
Retire bitbase.h
...
Moved the only prototipe where is needed.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-11-07 10:53:19 +01:00
Marco Costalba
2adbb80b8b
Space inflate bitbase.cpp
...
Also heavy cleanup while there.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-07-11 12:05:06 +01:00
Marco Costalba
9fc602bae7
Updated copyright year to 2010
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2010-03-20 11:27:07 +01:00
Marco Costalba
5c81602d14
Update copyright year
...
We are well in 2009 already.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-05-07 14:54:40 +02:00
Marco Costalba
feb5342b39
Safe guard some wild and ugly casts
...
These casts are needed but plain ugly, at least be
sure they don't hide any subtle conversion bug.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-16 13:59:41 +01:00
Marco Costalba
b870f5a091
Silence a good bunch of Intel warnings
...
Note that some pawns and material info has been switched
to int from int8_t.
This is a waste of space but it is not clear if we have a
faster or slower code (or nothing changed), some test should be
needed.
Few warnings still are alive.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-03-15 18:19:08 +01:00
Marco Costalba
c97104e854
Big trailing whitespace cleanup part 1
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2009-01-07 15:47:59 +01:00
Marco Costalba
5dc2312121
Update copyright info
...
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:20 +02:00
Marco Costalba
bb751d6c89
Initial import of Glaurung 2.1
2008-09-01 07:59:13 +02:00