Skip to content

Instantly share code, notes, and snippets.

@nobsun
Created December 25, 2023 12:27
Show Gist options
  • Save nobsun/a48221bbf90c0d4b910ed8c83b45ccfd to your computer and use it in GitHub Desktop.
Save nobsun/a48221bbf90c0d4b910ed8c83b45ccfd to your computer and use it in GitHub Desktop.
{-# LANGUAGE GHC2021 #-}
module Main where
import Data.Char
import System.Environment
import System.Random.Shuffle
main :: IO ()
main = do
{ args <- getArgs
; case args of
[] -> putStrLn . unwords . map (:[]) =<< shuffleM "アイウエオ"
s:_ | all isDigit s -> putStrLn . unwords . map show =<< shuffleM [1 .. read @Int s]
| otherwise -> putStrLn . unwords . map (:[]) =<< shuffleM s
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment