aboutsummaryrefslogtreecommitdiff
path: root/src/Wordle.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-03-09 00:40:17 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-03-09 00:40:17 -0700
commit5f31759994fc263e45ed067847b439bc30a53f0a (patch)
tree3ffcc20aa3be556009c861df10e917ac38773625 /src/Wordle.hs
parent66e9d8b8477075705d609a15f74eecd4e5304247 (diff)
downloadwordleai-master.tar.gz
wordleai-master.tar.bz2
wordleai-master.zip
Initial AI Commit.HEADmaster
Diffstat (limited to 'src/Wordle.hs')
-rw-r--r--src/Wordle.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wordle.hs b/src/Wordle.hs
new file mode 100644
index 0000000..d722ffa
--- /dev/null
+++ b/src/Wordle.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE ExistentialQuantification, RankNTypes, GADTs #-}
+module Wordle where
+
+import Data.Set (Set)
+import qualified Data.Set as Set
+
+data Environment = Environment {
+ wordLength :: Int,
+ wordList :: Set String
+}
+
+newtype Hints = Hints [(Char, Hint)]
+
+data Hint = Correct | Contains | DoesNotContain
+
+data AI where
+ AI :: forall s. {
+ internalState :: s,
+ guessWord :: s -> Environment -> IO String,
+ updateHints :: s -> Hints -> IO s
+ } -> AI