Skip to content

Instantly share code, notes, and snippets.

Karl-Oskar Rikås funrep

View GitHub Profile
View helmlenses.hs
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TemplateHaskell #-}
import Control.Applicative
import FRP.Elerea.Simple
import GHC.Float
import FRP.Helm hiding (join, x, y)
import Control.Monad
import Control.Arrow ((&&&), first, second)
View gist:7a1ad3aed6dfc1236e0eae891786c6ef
def min_max(board, depth, maximizingPlayer):
validMoves = get_valid_moves(board)
bestMove = [-1,-1]
if depth == 0 or validMoves == []:
return evaluate_score(board)
# no indent here
if maximizingPlayer:
maxEval = -sys.maxsize
for move in validMoves:
child = get_board_copy(board)
You can’t perform that action at this time.