每个数字都可以表示为ASCII。例如,0在ASCII是48,1是49,等等。使用这种将数字转换为其他数字的方法,可以无限扩展一个数字,方法是用其ASCII值替换其所有数字,并对结果执行相同的操作。例如,如果您从0开始,您将扩展到48,然后扩展到5256,等等。
Digit = 0, N = 3 Output = 53505354Digit = 2, N = 2 Output = 5348Digit = 5, N = 0 Output = 5这是密码-高尔夫,所以最短的答案(以字节为单位)获胜!
发布于 2019-10-23 06:41:59
FÇJ以N作为第一输入,以数字作为第二输入。
F # Loop the (implicit) first input (N) amount of times
Ç # Convert the characters in the string at the top of the stack to its unicode values
# (which will take the second input implicitly in the first iteration)
J # Join these unicode integers together to a single string
# (after the loop, the result is output implicitly)发布于 2019-10-23 00:27:15
https://codegolf.stackexchange.com/questions/194722
复制相似问题