Skip to content

Instantly share code, notes, and snippets.

View davidsonbrsilva's full-sized avatar

Davidson Bruno davidsonbrsilva

View GitHub Profile
@caotic123
caotic123 / astar.hs
Last active May 27, 2019 13:43
8 puzzle : A* game solver
import Control.Monad
import Data.Maybe
import qualified Data.Set as Set
import qualified Data.Map.Strict as Map
data Puzzle = Puzzle [Int] Int Int Int deriving Show
heuristic_comp :: [Int] -> Int
heuristic_comp [] = 8
heuristic_comp (x : xs) = do