Answers:
∞┼,
它不适用于空输入,因为与其他语言相比,欧姆在输入处理方面很糟糕,但是您可以输入“”。
说明
∞ Infinite loop next code (until ";" or end of line)
┼ Get first input
, Println
,[>,]++++++++++[[<]>[.>]<]
吗?
V
因为直到它完成它输出的nvim会议的内部,而不是打印到stdout,TIO杀死会话时,看到一个STDOUT什么。我不知道您说什么,但很遗憾,它不能解决V
与-n
标志一起运行。
loop{$><<$_}
编辑:感谢@sethrin的-n
标志!
-n
标志并跳过gets
。
OP没有具体说明如何输出应该发生,仅表示,已与后一个换行符无休止地发生。AHK不是为cmd交互量身定制的。因此,输出ToolTip
在鼠标位置的a 处重复发生:
loop
tooltip,%1%`n`n
我喜欢AHK的loop
功能。loop
永远重复下一个块,loop, 10
将重复10次。有时我会错过其他语言(例如Python)的此功能。
AutoHotkey中的转义字符是`
(因此Windows路径中的反斜杠没有问题)。由于某种原因,尾随的换行符将被忽略,因此需要两次。(trayTip
可能没有这个“ bug”,但是我无法测试它,因为使用wine运行)
loop
msgbox,%1%
我只是意识到OP可能不会喜欢这种解决方案,输出是通过用户交互进行的,并且不包含换行符。我会寻找另一种方式。
s=input()
while 1:print s
输入应该是Python文字(字符串,方括号或带逗号分隔的列表/元组等的括号等)。
Python 3将是+1字节,因为它print
是一个函数,但也可以进行原始输入,而不会给raw_input()
Python 2 带来4字节的损失。
OpU;ß
Explanation
OpU; output the input with a newline
ß run the code again with the same input
s=>{for(;;)System.Console.WriteLine(s);}
`GDT
Explanation
` % Do...while loop
G % Grab input
D % Display it on a new line
T % Literal TRUE to create an infinite loop
f(char*s){for(;;)puts(s);}
A function, f
, that takes a C-style string as a parameter, s
. The body of the function loops repeatedly, passing the string to the library function puts
, which outputs the string to the standard output (stdout) along with a trailing new-line.
Pretty simple stuff. The only hack here is taking advantage of default-int for the return value and then not actually returning a value. That doesn't matter in this case, though, since the function never returns (it just keeps printing forever)!
f(char*s){puts(s);f(s);}
saves a few
s->{for(;;System.out.println(s));}
Surprised there wasn't a Java answer yet.
Try it here. (Wait 60 second for it to time-out.)
Real time: 60.008 s
according to the Debug-section before it outputs the result (and gives two warnings 60-sec limit exceeded and 128kb exceeded).
#
Unfortunately I can't remove Q
:(
You need to run from command-line like this, so that this is competing:
python3 pyth.py -c "#
"
The interpreter has been fixed too.
i:0(?v
:o71.>~a{
As mentioned in the comments below my first attempt may have misunderstood the question so the newer 16 byte solution has been made, I have left the original below so people may see.
<ov!?+1:i
oa<
while(1){print"$ARGV[0]\n"}