banner stuff

This commit is contained in:
rhiannon morris 2022-04-11 14:09:37 +02:00
parent 13b173322b
commit 00997dff13

View file

@ -9,19 +9,57 @@ import public Quox.Pretty
import Data.Nat
import Data.Vect
import Control.ANSI
public export
record BannerOpts where
constructor MakeBannerOpts
unicode, color : Bool
public export
defBannerOpts : BannerOpts
defBannerOpts = MakeBannerOpts {unicode = True, color = True}
private
text : BannerOpts -> List String
text _ =
["",
#" ___ ___ _____ __ __"#,
#"/ _ `/ // / _ \\ \ /"#,
#"\_, /\_,_/\___/_\_\"#,
#" /_/"#,
""]
private
qtuwu : BannerOpts -> List String
qtuwu opts =
if opts.unicode then
[#" ___,-´⎠ "#,
#"(·`──´ ◡ -´⎠"#,
#" \/´/`´ "#,
#" ⋃────,-₎ ⎞ "#,
#" (‾‾) ⎟ "#,
#" (‾‾‾) ⎟ "#]
else
[#" ___,-´/ "#,
#"(.`--´ u -´/"#,
#" \/\/--´|/`--´ "#,
#" U----,-, \ "#,
#" (--) | "#,
#" (---) | "#]
private
join1 : BannerOpts -> String -> String -> String
join1 opts l r =
if opts.color then
" " <+> show (colored Green l) <+> " " <+> show (colored Magenta r)
else
" " <+> l <+> " " <+> r
export
banner : String
banner = #"""
_ ___,-´/
(.`--´ -´/ ___ ___ _____ __ __
\/\/--´`´`--´ / _ `/ // / _ \\ \ /
U ---, / \_, /\_,_/\___/_\_\
/--/ | /_/
/--/ |
"""#
banner : BannerOpts -> String
banner opts = unlines $ zipWith (join1 opts) (qtuwu opts) (text opts)
export
tm : Term 1 2
@ -32,6 +70,6 @@ tm =
main : IO Unit
main = do
putStrLn banner
putStrLn $ banner defBannerOpts
prettyTerm tm
prettyTerm $ pushSubstsT tm