Skip to content

Commit

Permalink
Merge branch 'i1811'
Browse files Browse the repository at this point in the history
  • Loading branch information
nionita committed Feb 15, 2019
2 parents f649572 + f90e3f6 commit 532e8db
Show file tree
Hide file tree
Showing 19 changed files with 1,794 additions and 1,179 deletions.
6 changes: 3 additions & 3 deletions Barbarossa-NB.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Barbarossa-NB.tex
\begin{hcarentry}{Barbarossa}
\report{Nicu Ionita}%11/17
\report{Nicu Ionita}%05/18
\status{actively developed}
\makeheader

Expand All @@ -18,8 +18,8 @@
write competitive software with Haskell. The speed of Barbarossa (measured in
searched nodes per second) is still far behind comparable engines written in C
or C++. Nevertheless Barbarossa can compete with many engines - as it can be
seen on the CCRL rating lists, where is it currently listed with a strength of
about 2200 ELO.
seen on the CCRL rating lists, where is it currently listed with a strength
of more than 2300 ELO (the last release version, see below).

Barbarossa uses a few techniques which are well known in the computer chess
scene:
Expand Down
71 changes: 67 additions & 4 deletions Barbarossa.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Name: Barbarossa
Version: 0.4.0
Version: 0.5.0
Synopsis: UCI chess engine written in Haskell
License: BSD3
License-file: LICENSE
Author: Nicu Ionita
Maintainer: [email protected]
Copyright: Nicu Ionita 2013 - 2016
Copyright: Nicu Ionita 2013 - 2019
Category: Game
Build-type: Simple
Cabal-version: >=1.8
Expand All @@ -14,6 +14,10 @@ Flag sse42
Description: Enable SSE4.2 support
Default: False

Flag ddump
Description: Enable ddumps
Default: True

Executable Barbarossa
Main-is: Main/Barbarossa.hs
Build-depends:
Expand Down Expand Up @@ -64,11 +68,70 @@ Executable Barbarossa
-fspec-constr-count=24
-funfolding-use-threshold=32
-fno-warn-tabs
-- -ddump-simpl -ddump-to-file -dsuppress-all -dsuppress-uniques
-- -ddump-opt-cmm -ddump-asm
CPP-Options: -DSMSTRICT
if flag(sse42)
GHC-Options: -msse4.2
if flag(ddump)
GHC-Options: -ddump-simpl -ddump-to-file -dsuppress-all -dsuppress-uniques
-ddump-opt-cmm -ddump-asm

Executable SelfPlay
Main-is: Main/SelfPlay.hs
Build-depends:
base >= 4.5,
array,
old-time,
containers,
filepath,
mtl,
parsec,
vector,
vector-algorithms,
random,
directory,
transformers,
QuickCheck,
text
Other-modules:
Eval.BasicEval,
Eval.Eval,
Eval.FileParams,
Hash.TransTab,
Hash.Zobrist,
Moves.Base,
Moves.BaseTypes,
Moves.BitBoard,
Moves.Board,
Moves.Fen,
Moves.GenMagics,
Moves.History,
Moves.Magics,
Moves.Moves,
Moves.Notation,
Moves.Pattern,
Moves.ShowMe,
Search.Albeta,
Search.AlbetaTypes,
Search.CStateMonad,
Struct.Config,
Struct.Context,
Struct.Status,
Struct.Struct,
Uci.UCI,
Uci.UciGlue
GHC-Options: -O2 -Wall
-funbox-strict-fields
-threaded
-rtsopts -with-rtsopts=-N3
-fspec-constr-count=24
-funfolding-use-threshold=32
-fno-warn-tabs
CPP-Options: -DSMSTRICT
if flag(sse42)
GHC-Options: -msse4.2
if flag(ddump)
GHC-Options: -ddump-simpl -ddump-to-file -dsuppress-all -dsuppress-uniques
-ddump-opt-cmm -ddump-asm

-- Executable Evolve
-- Main-is: Main/Evolve.hs
Expand Down
24 changes: 9 additions & 15 deletions Eval/BasicEval.hs
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
module Eval.BasicEval (
matPiece
matPiece, seeValue
) where

-- import Data.Array.Unboxed
-- import Data.Array.Base
-- import GHC.Arr (unsafeIndex)

import Struct.Struct

{--
matvals :: UArray Piece Int
matvals = listArray (Pawn, King) [ 100, 325, 325, 500, 975, 20000 ]
--}

matPiece1 :: Piece -> Int
matPiece1 Pawn = 100
matPiece1 Knight = 360
matPiece1 Bishop = 361
matPiece1 Bishop = 360
matPiece1 Rook = 565
matPiece1 Queen = 1100
matPiece1 King = 20000
Expand All @@ -29,7 +20,10 @@ fun Black = negate
matPiece :: Color -> Piece -> Int
matPiece c = fun c . matPiece1

{-
matPiece White = unsafeAt matvals . unsafeIndex (Pawn, King)
matPiece Black = negate . unsafeAt matvals . unsafeIndex (Pawn, King)
-}
seeValue :: Piece -> Int
seeValue Pawn = 1
seeValue Knight = 3
seeValue Bishop = 3
seeValue Rook = 5
seeValue Queen = 10
seeValue King = 200
Loading

0 comments on commit 532e8db

Please sign in to comment.