Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
23 lines (18 sloc) 475 Bytes
module Main where
import Control.Monad
import Data.Foldable
import ImperativeVty
drawCenteredTextBlock :: [String] -> IO ()
drawCenteredTextBlock ss = do
(ww, hh) <- getScreenSize
let w = maximum (0 : fmap length ss)
let h = length ss
let x = (ww - w) `div` 2
let y = (hh - h) `div` 2
for_ (zip [0..] ss) $ \(i, s) -> do
putStrAt (x, y + i) s
main :: IO ()
main = withTerminal $ do
drawCenteredTextBlock ["hello world"]
void waitForKey