-
-
Save mmynsted/7831dbd552c1f874143c0e0d5807a4c8 to your computer and use it in GitHub Desktop.
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main | |
where | |
-- import Data.Text as T | |
main = putStrLn $ f 2 | |
f :: Int -> String | |
f n | |
| n < 0 = mconcat $ take 3 x | |
| n > 3 = mconcat $ take 3 y | |
| otherwise = mconcat $ take n y <> take (3 - n) x | |
where | |
x = "☆" : x | |
y = "★" : y |
Author
mmynsted
commented
Dec 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment