Skip to content

Instantly share code, notes, and snippets.

@ysnrkdm
Created December 1, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysnrkdm/ae23c369676426a4db2e to your computer and use it in GitHub Desktop.
Save ysnrkdm/ae23c369676426a4db2e to your computer and use it in GitHub Desktop.
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