Skip to main content
Commonmark migration
Source Link

MathGolf, 8 6 5 4 bytes

{└§p

Try it online!

Outputs a newline separated series.

###Explanation:

Explanation:

{└§p
{       Start a loop over the range(0, input)
 └      Push the top of stack (implicitly the index of the loop) + 1
  §     Concatenate the two (this removes leading 0s)
   p    And print the value

MathGolf, 8 6 5 4 bytes

{└§p

Try it online!

Outputs a newline separated series.

###Explanation:

{└§p
{       Start a loop over the range(0, input)
 └      Push the top of stack (implicitly the index of the loop) + 1
  §     Concatenate the two (this removes leading 0s)
   p    And print the value

MathGolf, 8 6 5 4 bytes

{└§p

Try it online!

Outputs a newline separated series.

Explanation:

{└§p
{       Start a loop over the range(0, input)
 └      Push the top of stack (implicitly the index of the loop) + 1
  §     Concatenate the two (this removes leading 0s)
   p    And print the value
-1 byte
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

MathGolf, 8 6 5 54 bytes

Éï└§]{└§p

Try it online!Try it online!

ReturnsOutputs a array of numbersnewline separated series. Alternatively, space separated numbers

###Explanation:

Éï└§]{└§p
É {       Start block of size 3
         This implicitly starts a for loop over the implicitrange(0, input)
 ï       Push the indextop of the loopstack (0-indexed)
  └      Pushimplicitly the topindex of stackthe loop) + 1
   §     Concatenate the two (this removes leading 0s)
    ]p    And arrayify the stack afterprint the loop is donevalue

You could also use the î (push 1-index of loop) instead of .

MathGolf, 8 6 5 bytes

Éï└§]

Try it online!

Returns a array of numbers. Alternatively, space separated numbers

###Explanation:

Éï└§]
É        Start block of size 3
         This implicitly starts a for loop over the implicit input
 ï       Push the index of the loop (0-indexed)
  └      Push the top of stack + 1
   §     Concatenate the two (removes leading 0s)
    ]    And arrayify the stack after the loop is done

You could also use the î (push 1-index of loop) instead of .

MathGolf, 8 6 5 4 bytes

{└§p

Try it online!

Outputs a newline separated series.

###Explanation:

{└§p
{       Start a loop over the range(0, input)
       Push the top of stack (implicitly the index of the loop) + 1
  §     Concatenate the two (this removes leading 0s)
   p    And print the value
-1 byte
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

MathGolf, 8 6 65 bytes

æî_ \;Éï└§]

Try it online!Try it online!

PrintsReturns a trailing spacearray of numbers. Alternatively, space separated numbers

###Explanation:

æî_ \;Éï└§]
æÉ        Start Blockblock of length 4. Implicitly thissize is3
 a foreach loop over the input
 î  This implicitly starts a for loop Getover the loop indeximplicit (1-indexed)input
  _ï       DuplicatePush the index
       of the loop (Space0-indexed) Push a space character
    \     Swap lastPush twothe characters
top of stack + 1
   §   This loop leavesConcatenate usthe withtwo an(removes extraleading number0s)
 at the end
 ]    ;And arrayify the stack Popafter the number

Alternatively,

Éï└loop ⌐;is done

Try it online! You could also use the î (push 1-index of loop) instead of .

MathGolf, 8 6 bytes

æî_ \;

Try it online!

Prints a trailing space

###Explanation:

æî_ \;
æ         Block of length 4. Implicitly this is a foreach loop over the input
 î        Get the loop index (1-indexed)
  _       Duplicate the index
          (Space) Push a space character
    \     Swap last two characters
          This loop leaves us with an extra number at the end
     ;    Pop the number

Alternatively,

Éï└ ⌐;

Try it online!

MathGolf, 8 6 5 bytes

Éï└§]

Try it online!

Returns a array of numbers. Alternatively, space separated numbers

###Explanation:

Éï└§]
É        Start block of size 3
         This implicitly starts a for loop over the implicit input
 ï       Push the index of the loop (0-indexed)
        Push the top of stack + 1
   §     Concatenate the two (removes leading 0s)
    ]    And arrayify the stack after the loop is done

You could also use the î (push 1-index of loop) instead of .

-2 bytes
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
deleted 14 characters in body
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading