…( )7ÝJ»•αγʒδÓ₂©8¥ŽQxΣxêÿ•12вèJIvN”</[(
._-=:"ÆŸ,*”º•DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλݺ•20в趡Nè4äyè.;
@Grimyのおかげで-6バイト。
オンラインそれを試してみたり、さらにいくつかのテストケースを確認してください。
説明:
最初にテンプレート文字列を作成します。
…( ) # Push string "( )"
7ÝJ # Push a list in the range [0,7] joined together: "01234567"
» # Join both by a newline: "( )\n01234567"
•αγʒδÓ₂©2°ćì₂òη₆½•
# Push compressed integer 80545642885242518310229085147411483894
12в # Convert it to Base-12 as list: [1,4,4,4,4,4,3,1,4,4,4,4,4,3,8,0,6,5,7,2,9,3,8,0,10,10,10,2,9,3,1,0,11,11,11,2]
è # Index each into the string: [" ","0","0","0","0","0","\n"," ","0","0","0","0","0","\n","4","(","2","1","3",")","5","\n","4","(","6","6","6",")","5","\n"," ","(","7","7","7",")"]
J # And join it to a single string: " 00000\n 00000\n4(213)5\n4(666)5\n (777)"
次のようになります:
00000
00000
4(213)5
4(666)5
(777)
次に、入力の桁をループします。
I # Get the input
v # Loop `y` over each of its digits:
そして、以下を実行します:リスト
の(0インデックス付き)インデックスN
をプッシュします。
N # Push the index of the loop
可能なすべての部分を文字リストのリストとしてプッシュします。
”</[(
._-=:"ÆŸ,*”
"# Push dictionary string "</[(\n._-=:" Oo,*"
º # Mirror each line: "</[()]\>\n._-=:" Oo,**,oO ":=-_."
•DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλݺ•
# Push compressed integer 492049509496347122906361438631265789982480759119518961177677313610613993948059787418619722816092858096158180892708001681647316210
20в # Convert it to Base-20 as list: [15,10,10,10,15,3,10,19,10,4,15,15,15,15,15,10,12,12,12,10,15,10,10,10,15,9,9,9,9,9,15,15,10,15,15,15,1,10,6,15,8,15,18,9,10,8,11,9,17,16,8,11,9,17,16,8,15,15,15,0,6,15,15,1,8,15,15,15,7,1,15,15,6,8,15,15,15,15,13,15,5,15,2,7,15,0,8,15,15,15,15,13,15,14,15,14,10,10,10]
è # Index each into the string: [" ","_","_","_"," ","(","_","*","_",")"," "," "," "," "," ","_","=","=","=","_"," ","_","_","_"," ",".",".",".",".","."," "," ","_"," "," "," ","/","_","\"," ","\n"," ",",",".","_","\n","-",".","o","O","\n","-",".","o","O","\n"," "," "," ","<","\"," "," ","/","\n"," "," "," ",">","/"," "," ","\","\n"," "," "," "," ",":"," ","]"," ","[",">"," ","<","\n"," "," "," "," ",":"," ","""," ",""","_","_","_"]
¶¡ # Split it by the newline character: [[" ","_","_","_"," ","(","_","*","_",")"," "," "," "," "," ","_","=","=","=","_"," ","_","_","_"," ",".",".",".",".","."," "," ","_"," "," "," ","/","_","\"," "],[" ",",",".","_"],["-",".","o","O"],["-",".","o","O"],[" "," "," ","<","\"," "," ","/"],[" "," "," ",">","/"," "," ","\"],[" "," "," "," ",":"," ","]"," ","[",">"," ","<"],[" "," "," "," ",":"," ","""," ",""","_","_","_"]]
ループインデックスN
を使用して、現在作業しているパーツの文字リストを取得します。
Nè # Index the loop index into it
# i.e. 6 → [" "," "," "," ",":"," ","]"," ","[",">"," ","<"]
次に、文字リストを4つの等しい部分に分割し、入力数字y
(1から始まる)を使用してインデックスを作成します。(注:。05AB1Eは0インデックスですが、入力が1インデックスである、インデックスの前に1桁を低下させるために論理的になるので05AB1Eは、自動ラップアラウンドを持っているので、(つまり、インデックス3
リストでは、[1,3,5]
になります1
)、単にIチャレンジの説明でnr 4のパーツがリストの先頭にくるように、パーツを1回回転しました。)
4ä # Split it into 4 equal parts
# i.e. [[" "," "," "],[" ",":"," "],["]"," ","["],[">"," ","<"]]
yè # Index the input-digit `y` into it (with automatic wraparound)
# i.e. 4 → [" "," "," "]
そして、最初にプッシュしたループのインデックスが0のインデックスを、部分文字で1つずつ置き換えます。
.; # Replace first; every index of the loop `N` in the template-string
# is replaced one by one with the characters
そして最終的に、結果は暗黙的に出力されます。
この05AB1E鉱山の先端を参照してください(セクション大きな整数を圧縮する方法は?とどのように整数のリストを圧縮するの?)圧縮部品がどのように機能するかを理解すること。
私のお気に入りについては、Javaソリューションを投稿した1.5年前と同じ「雪うさぎ」のままです。
44114432:
_
(_*_)
(. .)
(> <)
(" ")