空格,84字节
[S S S T S S S S S N
_Push_32][S N
S _Duplicate][T N
S S _Print_as_character][S N
S _Duplicate][T N
T T _Read_STDIN_as_integer][T T T _Retrieve][S S S T N
_Push_1][T S S T _Subtract][S N
S _Duplicate][N
T S N
_If_0_Jump_to_Label_EXIT][S S S T S S T N
_Push_9][T N
S S Print_as_character][S S S T N
_Push_1][T S S T _Subtract][N
T S N
_If_0_Jump_to_Label_EXIT][S S S T S T S N
_Push_10][T N
S S _Print_as_character][N
S S N
_Create_Label_EXIT]
字母S
(空格),T
(制表符)和N
(换行符)仅作为突出显示而添加。
[..._some_action]
仅作为说明添加。
空格仅包含三个有效的“关键字”:空格,制表符和换行符。
伪代码中的解释:
Print space
Integer i = STDIN as integer - 1
If i is 0:
Exit program
Else:
Print tab
i = i - 1
If i is 0:
Exit program
Else:
Print new-line
Exit program
示例运行:
输入: 1
Command Explanation Stack Heap STDIN STDOUT STDERR
SSSTSSSSSN Push 32 [32]
SNS Duplicate top (32) [32,32]
TNSS Print as character [32] <space>
SNS Duplicate top (32) [32,32]
TNTT Read STDIN as integer [32] {32:1} 1
TTT Retrieve [1] {32:1}
SSSTN Push 1 [1,1] {32:1}
TSST Subtract top two (1-1) [0] {32:1}
SNS Duplicate top (0) [0,0] {32:1}
NTSN If 0: Jump to Label_EXIT [0] {32:1}
NSSN Create Label_EXIT [0] {32:1}
error
程序因错误而停止:未定义出口。
在线尝试(仅使用空格,制表符和换行符)。
输出单个空格。
输入: 2
Command Explanation Stack Heap STDIN STDOUT STDERR
SSSTSSSSSN Push 32 [32]
SNS Duplicate top (32) [32,32]
TNSS Print as character [32] <space>
SNS Duplicate top (32) [32,32]
TNTT Read STDIN as integer [32] {32:2} 2
TTT Retrieve [2] {32:2}
SSSTN Push 1 [2,1] {32:2}
TSST Subtract top two (2-1) [1] {32:2}
SNS Duplicate top (1) [1,1] {32:2}
NTSN If 0: Jump to Label_EXIT [1] {32:2}
SSSTSSTN Push 9 [1,9] {32:2}
TNSS Print as character [1] {32:2} \t
SSSTN Push 1 [1,1] {32:2}
TSST Subtract top two (1-1) [0] {32:2}
NTSN If 0: Jump to Label_EXIT [] {32:2}
NSSN Create Label_EXIT [] {32:2}
error
程序因错误而停止:未定义出口。
在线尝试(仅使用空格,制表符和换行符)。
输出一个空格,后跟一个制表符。
输入:(3
或更高)
Command Explanation Stack Heap STDIN STDOUT STDERR
SSSTSSSSSN Push 32 [32]
SNS Duplicate top (32) [32,32]
TNSS Print as character [32] <space>
SNS Duplicate top (32) [32,32]
TNTT Read STDIN as integer [32] {32:3} 3
TTT Retrieve [3] {32:3}
SSSTN Push 1 [3,1] {32:3}
TSST Subtract top two (3-1) [2] {32:3}
SNS Duplicate top (2) [2,2] {32:3}
NTSN If 0: Jump to Label_EXIT [2] {32:3}
SSSTSSTN Push 9 [2,9] {32:3}
TNSS Print as character [2] {32:3} \t
SSSTN Push 1 [2,1] {32:3}
TSST Subtract top two (2-1) [1] {32:3}
SSSTSTSN Push 10 [1,10] {32:3}
TNSS Print as character [1] {32:3} \n
NSSN Create Label_EXIT [] {32:3}
error
程序因错误而停止:未定义出口。
在线尝试(仅使用空格,制表符和换行符)。
输出一个空格,然后是一个选项卡,然后是一个换行符。