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 Answer

@Noodle9 Added.
Source Link
dingledooper
  • 23.4k
  • 1
  • 40
  • 130

C (gcc) , 50 bytes, -m32, 50 bytes

main(i){for(;puts(nl_langinfo(131079+i%7))-i++;);}

Try it online!

Explanation

Simply put, nl_langinfo() is a useful function which returns a particular string given an argument. It just turns out that the argument to pass for obtaining weekday names is 131079 ... 131086. One other thing is that we must add the flag -m32, which is explained nicely in this answer.

C (gcc) , 50 bytes, -m32

main(i){for(;puts(nl_langinfo(131079+i%7))-i++;);}

Try it online!

Explanation

Simply put, nl_langinfo() is a useful function which returns a particular string given an argument. It just turns out that the argument to pass for obtaining weekday names is 131079 ... 131086. One other thing is that we must add the flag -m32, which is explained nicely in this answer.

C (gcc) -m32, 50 bytes

main(i){for(;puts(nl_langinfo(131079+i%7))-i++;);}

Try it online!

Explanation

Simply put, nl_langinfo() is a useful function which returns a particular string given an argument. It just turns out that the argument to pass for obtaining weekday names is 131079 ... 131086. One other thing is that we must add the flag -m32, which is explained nicely in this answer.

Source Link
dingledooper
  • 23.4k
  • 1
  • 40
  • 130

C (gcc), 50 bytes, -m32

main(i){for(;puts(nl_langinfo(131079+i%7))-i++;);}

Try it online!

Explanation

Simply put, nl_langinfo() is a useful function which returns a particular string given an argument. It just turns out that the argument to pass for obtaining weekday names is 131079 ... 131086. One other thing is that we must add the flag -m32, which is explained nicely in this answer.

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