-
Notifications
You must be signed in to change notification settings - Fork 1
/
Shoes.hs
43 lines (35 loc) · 1.02 KB
/
Shoes.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
module Shoes
( Shoe(..)
, first_shoe
, shoe_list
, displayInfoShoe
) where
data Shoe = Shoe
{ shoeAttackBonus :: Int
, shoeHealthBonus :: Int
, shoeDefense :: Int
, shoeSpeed :: Int
, shoeName :: String
} deriving (Show, Eq)
first_shoe = Shoe 0 0 0 20 "Default Shoe"
attackShoe = Shoe 30 0 0 45 "Attack Shoe"
defenseShoe = Shoe 0 20 0 45 "Defense Shoe"
healthShoe = Shoe 0 0 50 45 "Health Shoe"
shoe_list = [attackShoe, defenseShoe, healthShoe]
--------------------------------------------------------------------
-- Display information of Shoe
--------------------------------------------------------------------
displayInfoShoe :: Shoe -> IO ()
displayInfoShoe shoe = do
putStrLn
$ "{"
++ show (shoeName shoe)
++ ": Attack Bonus: "
++ show (shoeAttackBonus shoe)
++ ", Health Bonus: "
++ show (shoeHealthBonus shoe)
++ ", Defense: "
++ show (shoeDefense shoe)
++ ", Speed: "
++ show (shoeSpeed shoe)
++ "}"