Skip to main content
Commonmark migration
Source Link

#Whitespace, 73 bytes

Whitespace, 73 bytes

[N S S N _Create_Label_LOOP][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][S N S _Duplicate_input][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_EXIT][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][T S S T _Subtract][N T S N _If_0_Jump_to_Label_LOOP][S S S N _Push_0][T N S T _Print_as_integer][N S S S N _Create_Label_EXIT] 

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Since Whitespace inputs one character at a time, the input should contain a trailing newline so it knows when to stop reading characters and the input is done.

Outputs 0 for falsey, or nothing for truthy.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Start LOOP: Character c = STDIN as character If(c == '\n'): Stop program Character d = STDIN as character If(c == d): Go to next iteration of LOOP Print 0 

#Whitespace, 73 bytes

[N S S N _Create_Label_LOOP][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][S N S _Duplicate_input][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_EXIT][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][T S S T _Subtract][N T S N _If_0_Jump_to_Label_LOOP][S S S N _Push_0][T N S T _Print_as_integer][N S S S N _Create_Label_EXIT] 

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Since Whitespace inputs one character at a time, the input should contain a trailing newline so it knows when to stop reading characters and the input is done.

Outputs 0 for falsey, or nothing for truthy.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Start LOOP: Character c = STDIN as character If(c == '\n'): Stop program Character d = STDIN as character If(c == d): Go to next iteration of LOOP Print 0 

Whitespace, 73 bytes

[N S S N _Create_Label_LOOP][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][S N S _Duplicate_input][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_EXIT][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][T S S T _Subtract][N T S N _If_0_Jump_to_Label_LOOP][S S S N _Push_0][T N S T _Print_as_integer][N S S S N _Create_Label_EXIT] 

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Since Whitespace inputs one character at a time, the input should contain a trailing newline so it knows when to stop reading characters and the input is done.

Outputs 0 for falsey, or nothing for truthy.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Start LOOP: Character c = STDIN as character If(c == '\n'): Stop program Character d = STDIN as character If(c == d): Go to next iteration of LOOP Print 0 
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#Whitespace, 73 bytes

[N S S N _Create_Label_LOOP][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][S N S _Duplicate_input][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_EXIT][S S S N _Push_0][S N S _Duplicate_0][T N T S _Read_input_as_character][T T T _Retrieve][T S S T _Subtract][N T S N _If_0_Jump_to_Label_LOOP][S S S N _Push_0][T N S T _Print_as_integer][N S S S N _Create_Label_EXIT] 

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Since Whitespace inputs one character at a time, the input should contain a trailing newline so it knows when to stop reading characters and the input is done.

Outputs 0 for falsey, or nothing for truthy.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Start LOOP: Character c = STDIN as character If(c == '\n'): Stop program Character d = STDIN as character If(c == d): Go to next iteration of LOOP Print 0