Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

6 of 6
Commonmark migration

Haskell, (削除) 56 (削除ここまで) (削除) 53 (削除ここまで) 52 Bytes

mapM(\x->putStrLn$init$[x..'Z']++['A'..x])['A'..'Z']

same length: (using a suggestion by @AndersKaseorg)

a=['A'..'Z']
mapM putStrLn[take 26$[x..'Z']++a|x<-a]

to do modular stuff you have to import Data.Char to get the chr function, (削除) 74 (削除ここまで) (削除) 59 (削除ここまで) 58 Bytes was the best I could get with that: (thanks to @nimi for suggesting the toEnum function)

a=[0..25]
mapM(\x->putStrLn[toEnum65ドル+(x+y)`mod`26|y<-a])a

This could probably be much shorter, but I don't know any Haskell golfing tricks.

used mapM instead of mapM_ (see @Lynn's comment)

KarlKastor
  • 2.4k
  • 1
  • 16
  • 17

AltStyle によって変換されたページ (->オリジナル) /