Skip to content

Instantly share code, notes, and snippets.

@ysnrkdm ysnrkdm/Main.hs
Created Dec 1, 2014

Embed
What would you like to do?
Test for move generation (very simple)
module Main where
-- friends
import qualified Usi
import qualified Board
import qualified Move
import qualified MoveGenerator
-- GHC
-- libraries
import Text.Printf (printf)
-- std
import Test.HUnit
import Test.Framework
import Test.Framework.Providers.HUnit
import Data.List
main :: IO ()
main = do
defaultMain $ hUnitTestToTests $ TestLabel "newMoveValidation" $ TestCase moveComp
moveComp = do
let board = Usi.bdFromSfen [
"l6nl/5+P1gk/2nl1S3/p1p4Pp/3P2Sp1/1PPb2P1P/P5KS1/R8/LN4bKL",
"w",
"GR5pnsg" ]
printf "board is now\n"
print board
printf "\n"
let moves = sort $ MoveGenerator.mvGenFull board
let movess = sort $ MoveGenerator.mvGenFullN board
print moves
printf "...\n"
print movess
printf "...\n"
moves @=? movess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.