Retourner au contenu associé (journal : Esod mumixam !)
Posté par max22 le 05 décembre 2014 à 15:27. En réponse au journal Esod mumixam !. Évalué à 10.
import Data.Char import Data.List import System.Environment zorglangue :: String -> String zorglangue = concatMap capReverse . splitWords w :: Char -> Bool w x = isAlphaNum x || x == '_' splitWords :: String -> [String] splitWords = groupBy (\a -> \b -> w a == w b) capReverse :: String -> String capReverse xs | not (all w xs) = xs capReverse xs = map cap $ zip (map (\x -> if isUpper x then toUpper else toLower) xs) (reverse xs) where cap (f, c) = f c main :: IO() main = getContents >>= putStrLn . unlines . map zorglangue . lines
$ echo "Zorglub, Au secours!" | ./zorglangue Bulgroz, Ua sruoces!
J'ai passé un bon vendredi...
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Haskell
Posté par max22 . En réponse au journal Esod mumixam !. Évalué à 10.
J'ai passé un bon vendredi...