Created
October 23, 2014 15:07
-
-
Save makenowjust/ff73bf25888d18886985 to your computer and use it in GitHub Desktop.
プロ生ちゃん #カレンダープログラミング プチコンテスト 2014。Ruby & PythonのPolyglotなコードです(2つファイルがありますがどちらも同じ内容です)
This file contains hidden or 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
"""#{require'date';D=Date;t=D.today;s=''; | |
(x=D.new(t.year,t.month,1).cwday%7).times{s<<' '}; | |
D.new(t.year,t.month,-1).day.times{|i|i+=1;s<<(i<10?' ':'')<<i.to_s<< | |
((x+i)%7==0??\n:' ')}; puts s;exit}""";__END__=0;1//2 | |
from calendar import *; from datetime import * | |
setfirstweekday(6);t=datetime.today() | |
print("\n".join(month(t.year,t.month).split("\n")[2:])[: -1]) | |
#/.hash |
This file contains hidden or 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
"""#{require'date';D=Date;t=D.today;s=''; | |
(x=D.new(t.year,t.month,1).cwday%7).times{s<<' '}; | |
D.new(t.year,t.month,-1).day.times{|i|i+=1;s<<(i<10?' ':'')<<i.to_s<< | |
((x+i)%7==0??\n:' ')}; puts s;exit}""";__END__=0;1//2 | |
from calendar import *; from datetime import * | |
setfirstweekday(6);t=datetime.today() | |
print("\n".join(month(t.year,t.month).split("\n")[2:])[: -1]) | |
#/.hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment