Skip to main content
-1 byte
Source Link
Jo King
  • 48.1k
  • 6
  • 131
  • 187

><>, 10 9 98 bytes

31\*n;562gn|    

Try it online!Try it online!

Try it doubled!Try it doubled!

Try it tripled!Try it tripled!

On the first run it simply multiplies 3*1 to output 3. WithI'm sure there's an 8 byte solution somewhere out there.

The unprintable at the second copyend has ASCII value 1, an extra 3and is appended to the stack, butonly fetched by the number below it is still a 1g, soet command on the output is still 1*3 = 3third iteration. For the third copy, the topfirst two items on the stack are 3,3 so the output is nowit prints 3*305 =, and then prints 915.

I'm sure there's an 8 byte solution somewhere out there.

><>, 10 9 bytes

31\*n;    

Try it online!

Try it doubled!

Try it tripled!

On the first run it simply multiplies 3*1 to output 3. With the second copy, an extra 3 is appended to the stack, but the number below it is still a 1, so the output is still 1*3 = 3. For the third copy, the top two items on the stack are 3,3 so the output is now 3*3 = 9.

I'm sure there's an 8 byte solution somewhere out there.

><>, 10 9 8 bytes

562gn| 

Try it online!

Try it doubled!

Try it tripled!

I'm sure there's an 8 byte solution somewhere out there.

The unprintable at the end has ASCII value 1, and is only fetched by the get command on the third iteration. For the first two it prints 05, and then prints 15.

-1 byte
Source Link
Jo King
  • 48.1k
  • 6
  • 131
  • 187

><>, 1010 9 bytes

31:!~\n;31\*n;    

Try it online!Try it online!

Try it doubled!Try it doubled!

Try it tripled!Try it tripled!

InitialisesOn the stack withfirst run it simply multiplies 3*1 to output 3,1,1.

Note the space on With the second line. This offsets the next copy of the line by 1, movingan extra 3 is appended to the pop command command intostack, but the path ofnumber below it is still a 1, so the pointeroutput is still 1*3 = 3. OnFor the third copy this pops both 1s, leaving the 3 to be printedtop two items on the stack are 3,3 so the output is now 3*3 = 9.

I'm sure there's an 8 byte solution somewhere out there.

><>, 10 bytes

31:!~\n;   

Try it online!

Try it doubled!

Try it tripled!

Initialises the stack with 3,1,1.

Note the space on the second line. This offsets the next copy of the line by 1, moving the pop command command into the path of the pointer. On the third copy this pops both 1s, leaving the 3 to be printed.

><>, 10 9 bytes

31\*n;    

Try it online!

Try it doubled!

Try it tripled!

On the first run it simply multiplies 3*1 to output 3. With the second copy, an extra 3 is appended to the stack, but the number below it is still a 1, so the output is still 1*3 = 3. For the third copy, the top two items on the stack are 3,3 so the output is now 3*3 = 9.

I'm sure there's an 8 byte solution somewhere out there.

Source Link
Jo King
  • 48.1k
  • 6
  • 131
  • 187

><>, 10 bytes

31:!~\n;   

Try it online!

Try it doubled!

Try it tripled!

Initialises the stack with 3,1,1.

Note the space on the second line. This offsets the next copy of the line by 1, moving the pop command command into the path of the pointer. On the third copy this pops both 1s, leaving the 3 to be printed.