forked from charleso/haskell-in-haste
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guess.hs
52 lines (43 loc) · 928 Bytes
/
Guess.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Chat.Bot.Guess where
import Chat.Bot.Answer.Guess
import Chat.Bot.Misc.Guess
import Chat.Data
{-
LEVEL: Easy
USAGE: /guess number
Guess a randomly number between 1 and 100.
EXAMPLE:
> /guess 50
higher
> /guess 100
lower
> /guess 75
hit
-}
-- |
--
-- This requires implementing comparing two numbers and display a message depending on the result
--
-- >>> guess 1 2
-- GuessLower
-- >>> guess 2 1
-- GuessHigher
-- >>> guess 2 2
-- GuessCorrect
guess :: Int -> Int -> GuessResult
guess secret number =
notImplemented "Guess.guessMe" (guessAnswer secret number)
-- |
--
-- Just print something nice for the user
guessRender :: GuessResult -> String
guessRender result =
notImplemented "Guess.guessRender" (guessRenderAnswer result)
-- See Misc/Guess.hs
{-
data GuessResult =
GuessLower
| GuessHigher
| GuessCorrect
deriving (Eq, Show)
-}