我刚刚在http://repl.it/2Om/6找到CodeGolf
个答案:
puts"The eight#{e="een-hundreds were a time for "}rum.
The ninet#{e}fun.
The two-thousands are a time to run
a civilized classroom.
"*(?X-??)
原帖:https://codegolf.stackexchange.com/a/40250
我很好奇,它是如何运作的?我以前从未见过(?X-??)
。这里发生了什么?
答案 0 :(得分:4)
?Char给出Char的ASCII码。
?X = "X".ord = 88
?? = "?".ord = 63
?X - ?? = 88-63 = 25
There is your integer: 25
Then "a"*25 = "aaaaaaaaaaaaaaaaaaaaaaaaa"