This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TicTacToe where | |
data Player = Player { symbol :: Char, name :: String } deriving (Eq) | |
data Cell = Cell {player :: Player} | Empty deriving (Eq) | |
data Board = Board { size :: Int, board :: [[Cell]] } | |
instance Show (Cell) where | |
show (Cell (Player symbol _)) = show symbol | |
show (Empty) = show ' ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
Guess, | |
chooseWord | |
-- playGame, | |
-- createHangman, | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
Guess, | |
chooseWord | |
-- playGame, | |
-- createHangman, | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
createHangman, | |
chooseWord, | |
playGame, | |
Guess | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
createHangman, | |
chooseWord, | |
playGame, | |
Guess | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
createHangman, | |
chooseWord, | |
playGame, | |
Guess | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
createHangman, | |
chooseWord, | |
playGame, | |
Guess | |
) where | |
import System.IO(readFile) | |
import System.Random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman( | |
Hangman, | |
createHangman, | |
chooseWord, | |
playGame) where | |
import System.IO(readFile) | |
import System.Random | |
import Data.Char(isLower) | |
import qualified Data.Map as Map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hangman where | |
import System.IO(readFile) | |
import System.Random | |
import Data.Char(isLower) | |
import qualified Data.Map as Map | |
data Space c = Space c | Unguessed deriving (Show, Eq) | |
data Hangman = Hangman { dictwords :: [String], guesses :: [String] } deriving (Show) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--myApply :: (Num a0) => (a0 -> a0 -> a0) -> [a0] -> a0 | |
--myApply func list | |
-- = func (head list) value | |
--where value = | |
data Fraction = Fraction { numerator :: Integer | |
,denominator :: Integer } deriving (Eq) | |
addFractions :: Fraction -> Fraction -> Fraction |