Skip to content

Commit

Permalink
The identity is changed on Barbarossa, other small changes, it compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nionita committed Apr 27, 2013
1 parent 3959d17 commit 2890d3e
Show file tree
Hide file tree
Showing 25 changed files with 5,339 additions and 125 deletions.
47 changes: 4 additions & 43 deletions Barbarossa.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,15 @@ Flag Profile
Executable Barbarossa
Main-is: Main/Barbarossa.hs
Build-depends: base >= 4.5, array, old-time, containers, mtl, parsec, vector,
random, stream-fusion, directory, transformers
random, stream-fusion, directory, transformers, QuickCheck
GHC-Options: -O2 -Wall
-funbox-strict-fields -threaded -rtsopts
-fspec-constr-count=24
-funfolding-use-threshold=32
-ddump-simpl -ddump-to-file -dsuppress-all -dsuppress-uniques
-ddump-opt-cmm -ddump-asm
-- -ddump-simpl -ddump-to-file -dsuppress-all -dsuppress-uniques
-- -ddump-opt-cmm -ddump-asm
if flag(profile)
-- GHC-Options: -auto-all -with-rtsopts="-p -hc -smemop.txt"
GHC-Options: -auto-all -with-rtsopts="-p"
else
-- GHC-Options: -with-rtsopts=-N2 -M256m -H128m
GHC-Options: -with-rtsopts=-N3

Executable FixPlayFen
Main-is: Main/MainFixPlayFen.hs
Build-depends: base >= 4.5, array, mtl, parsec, transformers, QuickCheck
GHC-Options: -O2 -Wall
-funbox-strict-fields -threaded -rtsopts
-fspec-constr-count=24
-funfolding-use-threshold=32
if flag(profile)
GHC-Options: -fprof-auto-top

{-
Executable BenchTransTab
Main-is: Tests/TestTransTab.hs
Build-depends: base >= 4, array, mtl, parsec, criterion, QuickCheck
GHC-Options: -O2 -Wall
-funbox-strict-fields
-fspec-constr-count=4 -funfolding-use-threshold=32

Executable VizGraph
Main-is: Main/VizGraph.hs
Build-depends: base >= 4
GHC-Options: -O2
CPP-Options: -DVIZTREE

Executable PlotEvolve
Main-is: Main/EvolveToPlot.hs
Build-depends: base >= 4, filepath, regex-compat

Executable Evolve
Main-is: Main/MainEvolve.hs
Build-depends: base >= 4, process, filepath, bytestring, old-locale, async
GHC-Options: -O2 -Wall -threaded -rtsopts

Executable CLOPDriver
Main-is: Main/MainCLOP.hs
Build-depends: base >= 4, process, filepath, bytestring, old-locale, async
GHC-Options: -O2 -Wall
-}
30 changes: 30 additions & 0 deletions Eval/BasicEval.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module Eval.BasicEval (
matPiece
) 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 = 325
matPiece1 Bishop = 325
matPiece1 Rook = 500
matPiece1 Queen = 975
matPiece1 King = 20000

{-# INLINE matPiece #-}
matPiece :: Color -> Piece -> Int
{-
matPiece c p = case c of
White -> matPiece1 p
Black -> - matPiece1 p
-}
matPiece White = unsafeAt matvals . unsafeIndex (Pawn, King)
matPiece Black = negate . unsafeAt matvals . unsafeIndex (Pawn, King)
Loading

0 comments on commit 2890d3e

Please sign in to comment.