< 100
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
module Main where
|
||||
|
||||
import System.Environment
|
||||
import Codingame
|
||||
import Simulation.Board
|
||||
import Simulation.Data
|
||||
import Data.Vector as V
|
||||
|
||||
main :: IO ()
|
||||
-- main = test
|
||||
main = bundle
|
||||
main = do
|
||||
bundle
|
||||
print $ sim1 (2,4)
|
||||
--test
|
||||
|
||||
test :: IO ()
|
||||
test = print $ Prelude.reverse $ loop1 (0,0) 10 []
|
||||
test = do
|
||||
args <- getArgs
|
||||
let simDepth = if Prelude.length args > 0 then read $ Prelude.head args :: Int else 3
|
||||
print $ Prelude.reverse $ loop1 (0,0) simDepth []
|
||||
|
||||
loop1 :: Pos -> Int -> [Pos] -> [Pos]
|
||||
loop1 pos depth acc
|
||||
@@ -21,7 +27,7 @@ loop1 pos depth acc
|
||||
in loop1 sim (depth - 1) acc'
|
||||
|
||||
sim1 :: Pos -> (Int, Pos)
|
||||
sim1 pos = simulate board1 (0, 100, pos, singleton (0,4))
|
||||
sim1 pos = (\(val, (_,_, pos, _)) -> (val, pos)) (simulate board1 (0, 100, pos, singleton (0,4)))
|
||||
|
||||
board1 :: Board
|
||||
board1 = fromList $ fmap fromList
|
||||
|
||||
Reference in New Issue
Block a user