{-# LANGUAGE NamedFieldPuns #-}
module Set.Ascii (cardLines) where
import Set.Card
selectArt :: Shading -> Symbol -> [String]
selectArt Open Diamond = [" "
," ╱╲ "
,"╱ ╲"
,"‾‾‾‾"]
selectArt Striped Diamond = [" "
," ╱╲ "
,"╱╱╲╲"
,"‾‾‾‾"]
selectArt Solid Diamond = [" "
," ╱╲ "
,"╱╳╳╲"
,"‾‾‾‾"]
selectArt Open Squiggle = ["___ "
,"╲ ╲"
,"╱ ╱"
,"‾‾‾ "]
selectArt Striped Squiggle = ["___ "
,"╲╲╲╲"
,"╱╱╱╱"
,"‾‾‾ "]
selectArt Solid Squiggle = ["___ "
,"╲╳╳╲"
,"╱╳╳╱"
,"‾‾‾ "]
selectArt Open Oval = [" __ "
,"╱ ╲"
,"╲ ╱"
," ‾‾ "]
selectArt Striped Oval = [" __ "
,"╱╱╲╲"
,"╲╲╱╱"
," ‾‾ "]
selectArt Solid Oval = [" __ "
,"╱╳╳╲"
,"╲╳╳╱"
," ‾‾ "]
cardLines :: Card -> (Color, [String])
cardLines Card {color, count, shading, symbol}
= (color, map (duplicate count) (selectArt shading symbol))
duplicate :: Count -> String -> String
duplicate One x = " " ++ x ++ " "
duplicate Two x = " " ++ x ++ " " ++ x ++ " "
duplicate Three x = " " ++ x ++ " " ++ x ++ " " ++ x ++ " "