Skip to main content
(1st entry) stuff is messing with the leaderboard
Source Link
Downgoat
  • 29.1k
  • 6
  • 84
  • 155

Brainfuck, 40 bytes

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Brainfuck, 40 bytes (1st entry)

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

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Brainfuck, 40 bytes (1st entry)

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

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]

Brainfuck, 40 bytes

My console doesn't support Right-to-Left characters, but I don't think it will work :c

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

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]
They convinced me to post this as separate answer.
Source Link
yyny
  • 1.2k
  • 7
  • 9

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Here are some entries anyway:

Brainfuck, 40 bytes (1st entry)

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

C, 74 bytes

char m[2<<9];i;main(){do{m[i]=getchar();printf("%s ",m);}while(m[i++]>0);}

C, 105 bytes

m[2<<9];i;j;k;main(){while((m[i++]=getchar())<0);for(;j<i;j++,putchar(10))for(k=0;k<j;k++)putchar(m[k]);}

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]

#include <stdio.h>

// char, because `printf("%s", str);` expects a array of characters.
char str[2<<9];
int  str_len = 0;
int main(void) {
    do {
        str[str_len]=getchar();
        printf("%s ", str);
    } while(m[i++]>0);
    return 0;
}

#include <stdio.h>

int str[2<<9];
int str_len = 0;
int main(void) {
    do {
        str[str_len] = getchar();
    } while(str[str_len++] != EOF);
    int i;
    for(i=0; i<str_len; i++) {
        int j;
        for(j=0; j<i; j++) {
          putchar(str[j]);
        }
        putchar(10);
    }
}

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Here are some entries anyway:

Brainfuck, 40 bytes

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

C, 74 bytes

char m[2<<9];i;main(){do{m[i]=getchar();printf("%s ",m);}while(m[i++]>0);}

C, 105 bytes

m[2<<9];i;j;k;main(){while((m[i++]=getchar())<0);for(;j<i;j++,putchar(10))for(k=0;k<j;k++)putchar(m[k]);}

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]

#include <stdio.h>

// char, because `printf("%s", str);` expects a array of characters.
char str[2<<9];
int  str_len = 0;
int main(void) {
    do {
        str[str_len]=getchar();
        printf("%s ", str);
    } while(m[i++]>0);
    return 0;
}

#include <stdio.h>

int str[2<<9];
int str_len = 0;
int main(void) {
    do {
        str[str_len] = getchar();
    } while(str[str_len++] != EOF);
    int i;
    for(i=0; i<str_len; i++) {
        int j;
        for(j=0; j<i; j++) {
          putchar(str[j]);
        }
        putchar(10);
    }
}

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Brainfuck, 40 bytes (1st entry)

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

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]
Source Link
yyny
  • 1.2k
  • 7
  • 9

My console doesn't support Right-to-Left characters, but I don't think it will work :c

Here are some entries anyway:

Brainfuck, 40 bytes

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

C, 74 bytes

char m[2<<9];i;main(){do{m[i]=getchar();printf("%s ",m);}while(m[i++]>0);}

C, 105 bytes

m[2<<9];i;j;k;main(){while((m[i++]=getchar())<0);for(;j<i;j++,putchar(10))for(k=0;k<j;k++)putchar(m[k]);}

Ungolfed:

++++++++++> # Store 10 (Newline)
,[>,]       # Store input
<[<]>       # Goto first character
[           # While next character
  [<+>-]    # Copy character to the left
  <[<]>     # Goto first character
  [.>]      # Print all charaters
  >         # Go to next character
]

#include <stdio.h>

// char, because `printf("%s", str);` expects a array of characters.
char str[2<<9];
int  str_len = 0;
int main(void) {
    do {
        str[str_len]=getchar();
        printf("%s ", str);
    } while(m[i++]>0);
    return 0;
}

#include <stdio.h>

int str[2<<9];
int str_len = 0;
int main(void) {
    do {
        str[str_len] = getchar();
    } while(str[str_len++] != EOF);
    int i;
    for(i=0; i<str_len; i++) {
        int j;
        for(j=0; j<i; j++) {
          putchar(str[j]);
        }
        putchar(10);
    }
}