Skip to content

Instantly share code, notes, and snippets.

@Epitaph64
Epitaph64 / hangman.hs
Created Nov 15, 2013
Haskell Hangman
View hangman.hs
import System.IO
import Data.List
import Data.Char
display :: String -> String
display word = intersperse ' ' [if c `elem` ['a'..'z'] then '_' else c | c <- word]
makeGuess :: String -> Char -> Int -> IO ()
makeGuess word letter guesses
| letter `elem` word = play [if letter == c then toUpper letter else c | c <- word] guesses
View qa-template.tex
% Written HW (Questions & Answers) Template
% - Created by Walter Macfarland
% A few abbreviations used throughout this template:
% Q - Question
% A - Answer
% N - Question Number
\documentclass[12pt]{article}
\usepackage{fullpage}
You can’t perform that action at this time.