这是受魔法八字骨灰瓮的一个C1的启发。
给定两个参数,一个正整数和一个字符串/字符列表:
Input:
2740, ["|","_"]
2740 -> 101010110100 in base 2
-> Replace 0s with "|" and 1s with "_"
Output: _|_|_|__|_||
Input:
698911, ["c","h","a","o"]
698911 -> 2222220133 in base 4
-> Replace 0s with "c", 1s with "h", 2s with "a", and 3s with "o"
Output -> "aaaaaachoo"
Input:
1928149325670647244912100789213626616560861130859431492905908574660758972167966, [" ","\n","|","_","-"]
Output:
__ __
| |_| |
___| |___
- - - -
- - - - - - -
- - - - - - - -
_______________
Input: 3446503265645381015412, [':', '\n', '.', '_', '=', ' ', ')', '(', ',']
Output:
_===_
(.,.)
( : )
( : )规则:
2-10的范围内有一个长度。也就是说,最小的基数是二进制,最大的是十进制(这里没有烦人的字母)。由于这是密码-高尔夫,每种语言的最短代码将获胜。(我知道你们所有打高尔夫球的语言都准备好了一个字节内建;)
发布于 2018-06-12 13:29:01
发布于 2018-06-12 12:12:01
https://codegolf.stackexchange.com/questions/166708
复制相似问题