Skip to main content
added 746 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26

Brainfuck, 179 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]>++++++ ++++[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] >++++++++++[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

The tape is initialised with ten nodes, each of which contains a one followed by a zero. The one is the initial value of the pin, and the zero facilitates navigation and acts as a placeholder for the space character. For each number in the input, that pin is incremented by 3; note that ord('O') - ord('.') = 33, and during the printing phase, the pin's value will be multiplied by 11. (This multiplication is also used to generate the space character.) The order of the pins from left to right on the tape is simply 1 up to 10. If the input ends with a 1010, a correction is made, since the 1010 is initially treated as a 11.

After the input has been processed, a negative one is placed after each row. Then the rows are processed one by oneprinted in a loop, with the number of leading spaces determined by the number of rows previously processed.

Brainfuck, 179 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]>++++++ ++++[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] >++++++++++[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

The tape is initialised with ten nodes, each of which contains a one followed by a zero. The one is the initial value of the pin, and the zero facilitates navigation and acts as a placeholder for the space character. For each number in the input, that pin is incremented by 3; note that ord('O') - ord('.') = 33, and during the printing phase, the pin's value will be multiplied by 11. (This multiplication is also used to generate the space character.) If the input ends with a 10, a correction is made, since the 10 is initially treated as a 1.

After the input has been processed, a negative one is placed after each row. Then the rows are processed one by one, with the number of leading spaces determined by the number of rows previously processed.

Brainfuck, 179 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]>++++++ ++++[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] >++++++++++[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

The tape is initialised with ten nodes, each of which contains a one followed by a zero. The one is the initial value of the pin, and the zero facilitates navigation and acts as a placeholder for the space character. For each number in the input, that pin is incremented by 3; note that ord('O') - ord('.') = 33, and during the printing phase, the pin's value will be multiplied by 11. (This multiplication is also used to generate the space character.) The order of the pins from left to right on the tape is simply 1 up to 10. If the input ends with a 10, a correction is made, since the 10 is initially treated as a 1.

After the input has been processed, a negative one is placed after each row. Then the rows are printed in a loop, with the number of leading spaces determined by the number of rows previously processed.

added 746 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26

Brainfuck, 181179 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]+++++++>]>++++++ +++.,>[>>]<<[++++[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] ++++++++++., >[>>]>++++++++++[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.Try it online.

The tape is initialised with ten nodes, each of which contains a one followed by a zero. The one is the initial value of the pin, and the zero facilitates navigation and acts as a placeholder for the space character. For each number in the input, that pin is incremented by 3; note that ord('O') - ord('.') = 33, and during the printing phase, the pin's value will be multiplied by 11. (This multiplication is also used to generate the space character.) If the input ends with a 10, a correction is made, since the 10 is initially treated as a 1.

After the input has been processed, a negative one is placed after each row. Then the rows are processed one by one, with the number of leading spaces determined by the number of rows previously processed.

Brainfuck, 181 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]+++++++ +++.,>[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] ++++++++++., >[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

Brainfuck, 179 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]>++++++ ++++[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] >++++++++++[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

The tape is initialised with ten nodes, each of which contains a one followed by a zero. The one is the initial value of the pin, and the zero facilitates navigation and acts as a placeholder for the space character. For each number in the input, that pin is incremented by 3; note that ord('O') - ord('.') = 33, and during the printing phase, the pin's value will be multiplied by 11. (This multiplication is also used to generate the space character.) If the input ends with a 10, a correction is made, since the 10 is initially treated as a 1.

After the input has been processed, a negative one is placed after each row. Then the rows are processed one by one, with the number of leading spaces determined by the number of rows previously processed.

deleted 6 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26

Brainfuck, 183181 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]+++++++ +++.,>[[>]>]<<[>[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] ++++++++++., >[[>]>]>[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.Try it online.

Brainfuck, 183 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]+++++++ +++.,>[[>]>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] ++++++++++., >[[>]>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

Brainfuck, 181 bytes

++++++++++[-[<<+>>-]+<<]>,[<[-]-[>-<-----]>++[-[>>+<<-]>>]>+++[<<],>,]<[,>>---[> >]<<+++[<<]]>->>->>>>->>>>>>->[[>>]>,<<+[++[>+++++++++++<-]<+]>>[++.>-.>]+++++++ +++.,>[>>]<<[.[<]<]<] 

Formatted:

++++++++++ [ -[<<+>>-] +<< ] >, [ <[-] -[>-<-----] >++ [ -[>>+<<-] >> ] >+++[<<] ,>, ] < [ ,>>---[>>] <<+++[<<] ] >->>->>>>->>>>>>-> [ [>>] >,< <+ [ ++[>+++++++++++<-] <+ ] >>[++.>-.>] ++++++++++., >[>>] <<[.[<]<] < ] 

Expects input without a trailing newline.

Try it online.

deleted 65 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading
deleted 10 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading
deleted 84 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading
deleted 1 character in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading
deleted 41 characters in body
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading
Source Link
Mitch Schwartz
  • 5.9k
  • 1
  • 28
  • 26
Loading