Skip to main content
Updating to new interpreter
Source Link
d01
  • 3.4k
  • 13
  • 26

Rattle, 12 bytes

|I=@P[gbb>]`

Try it Online!Try it Online!

Explanation

|              take string as input
 I             split string into characters and store in consecutive memory slots
  =@           set top of stack to the value of the pointer (i.e. length of string)
    P          set pointer to 0
     [....]`   repeat n times where n is the top of the stack
      g        get character in storage at pointer
       bb      add character to print buffer twice
         >     shift pointer right
               [print buffer output implicitly]

Rattle, 12 bytes

|I=@P[gbb>]`

Try it Online!

Explanation

|              take string as input
 I             split string into characters and store in consecutive memory slots
  =@           set top of stack to the value of the pointer (i.e. length of string)
    P          set pointer to 0
     [....]`   repeat n times where n is the top of the stack
      g        get character in storage at pointer
       bb      add character to print buffer twice
         >     shift pointer right
               [print buffer output implicitly]

Rattle, 12 bytes

|I=@P[gbb>]`

Try it Online!

Explanation

|              take string as input
 I             split string into characters and store in consecutive memory slots
  =@           set top of stack to the value of the pointer (i.e. length of string)
    P          set pointer to 0
     [....]`   repeat n times where n is the top of the stack
      g        get character in storage at pointer
       bb      add character to print buffer twice
         >     shift pointer right
               [print buffer output implicitly]
Source Link
d01
  • 3.4k
  • 13
  • 26

Rattle, 12 bytes

|I=@P[gbb>]`

Try it Online!

Explanation

|              take string as input
 I             split string into characters and store in consecutive memory slots
  =@           set top of stack to the value of the pointer (i.e. length of string)
    P          set pointer to 0
     [....]`   repeat n times where n is the top of the stack
      g        get character in storage at pointer
       bb      add character to print buffer twice
         >     shift pointer right
               [print buffer output implicitly]