treetreetreefiregoldtreetreetreetreegoldtreegoldtreegoldtreegoldtreegoldtreetreegoldtreegoldtreetreetreegoldtreetreetreewaterwatertreetreewatergoldgoldtreegoldtreegoldtreegoldtreegoldtreetreegoldtreegoldtreetreetreegoldtreetreefiregoldgoldwatermoontreemoontreegoldgoldtreewatergoldgoldtreetreegoldgoldtreetreemoonwatergoldgoldwatergoldtreetreemoongoldgoldmoon
を出力せよ
素直に書いて R で 171 文字解
策を弄して 166 154 150 文字解
GAWK では,BEGIN { } を除いて 178 165 文字解
当初の締め切り時間が過ぎたので,解をアップロードしておく
R は,以下の通り
a=gsub;cat(a(5,"moon",a(4,"water",a(3,"gold",a(2,"fire",a(1,"tree",a(6,31,"1112611166666166116114411436666616611612334515136436136154334615335")))))))
GAWK(MAWK)では,以下の通り(BEGIN{ と } を除く)
$0="1112611166666166116114411436666616611612334515136436136154334615335";gsub(6,31);gsub(1,"tree");gsub(2,"fire");gsub(3,"gold");gsub(4,"water");gsub(5,"moon");print