[N
S S N
_Create_Label_LOOP][S S S N
_Push_0][S N
S _Duplicate_0][T N
T S _Read_STDIN_as_character][T T T _Retrieve_input][S N
S _Duplicate][S S S T S T S N
_Push_10][T S S T _Subtract][N
T S S N
_If_0_Jump_to_Label_PRINT][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_PRINT][S N
N
_Discard_top][T N
S S _Print_as_character]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.
[..._some_action]
added as explanation only.
Since Whitespace can only take input as integer or character, we must add a trailing character to indicate we're done with the input-string after reading it character by character, for which I've used a newline.
Try it online (with raw spaces, tabs and new-lines only).
Example run: input = A2#
Command Explanation Stack Heap STDIN STDOUT STDERR
NSSN Create Label_LOOP []
SSSN Push 0 [0]
SNS Duplicate top (0) [0,0]
TNTS Read STDIN as character [0] {0:65} A
TTT Retrieve at heap address (0) [65] {0:65}
SNS Duplicate top (65) [65,65] {0:65}
SSSTSTSN Push 10 [65,65,10] {0:65}
TSST Subtract top two (65-10) [65,55] {0:65}
NTSSN If 0: Jump to Label_PRINT [65] {0:65}
NSNN Jump to Label_LOOP [65] {0:65}
SSSN Push 0 [65,0]
SNS Duplicate top (0) [65,0,0]
TNTS Read STDIN as character [65,0] {0:50} 2
TTT Retrieve at heap address (0) [65,50] {0:50}
SNS Duplicate top (50) [65,50,50] {0:50}
SSSTSTSN Push 10 [65,50,50,10] {0:50}
TSST Subtract top two (50-10) [65,50,40] {0:50}
NTSSN If 0: Jump to Label_PRINT [65,50] {0:50}
NSNN Jump to Label_LOOP [65,50] {0:50}
SSSN Push 0 [65,50,0]
SNS Duplicate top (0) [65,50,0,0]
TNTS Read STDIN as character [65,50,0] {0:35} #
TTT Retrieve at heap address (0) [65,50,35] {0:35}
SNS Duplicate top (35) [65,50,35,35] {0:35}
SSSTSTSN Push 10 [65,50,35,35,10] {0:35}
TSST Subtract top two (35-10) [65,50,35,25] {0:35}
NTSSN If 0: Jump to Label_PRINT [65,50,35] {0:35}
NSNN Jump to Label_LOOP [65,50,35] {0:35}
SSSN Push 0 [65,50,35,0]
SNS Duplicate top (0) [65,50,35,0,0]
TNTS Read STDIN as character [65,50,35,0] {0:10} \n
TTT Retrieve at heap address (0) [65,50,35,10] {0:10}
SNS Duplicate top (10) [65,50,35,10,10] {0:10}
SSSTSTSN Push 10 [65,50,35,10,10,10] {0:10}
TSST Subtract top two (10-10) [65,50,35,10,0] {0:10}
NTSSN If 0: Jump to Label_PRINT [65,50,35,10] {0:10}
NSSSN Create Label_PRINT [65,50,35,10] {0:10}
SNN Discard top [65,50,35] {0:10}
TNSS Print as character to STDOUT [65,50] {0:10} #
{0:10} error
Stops with the error: Exit not defined.