Skip to main content
Commonmark migration
Source Link

#Pylons, 16 Bytes.

Pylons, 16 Bytes.

i:At,{\,v\,v,A}c

How it works:

i    # Get command line input.
:At  # Set A equal to the top of the stack.
,    # Pop the stack.
{    # Start a for loop.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 ,   # Switch to loop iterations.
 A   # Iterate A times.
}    # End the for loop.
c    # Print the stack as a string

#Pylons, 16 Bytes.

i:At,{\,v\,v,A}c

How it works:

i    # Get command line input.
:At  # Set A equal to the top of the stack.
,    # Pop the stack.
{    # Start a for loop.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 ,   # Switch to loop iterations.
 A   # Iterate A times.
}    # End the for loop.
c    # Print the stack as a string

Pylons, 16 Bytes.

i:At,{\,v\,v,A}c

How it works:

i    # Get command line input.
:At  # Set A equal to the top of the stack.
,    # Pop the stack.
{    # Start a for loop.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 ,   # Switch to loop iterations.
 A   # Iterate A times.
}    # End the for loop.
c    # Print the stack as a string
Source Link
Morgan Thrapp
  • 3.7k
  • 15
  • 29

#Pylons, 16 Bytes.

i:At,{\,v\,v,A}c

How it works:

i    # Get command line input.
:At  # Set A equal to the top of the stack.
,    # Pop the stack.
{    # Start a for loop.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 ,   # Switch to loop iterations.
 A   # Iterate A times.
}    # End the for loop.
c    # Print the stack as a string