Skip to main content
deleted 22 characters in body
Source Link
Addison Crump
  • 11.2k
  • 1
  • 44
  • 90

Vitsy, 12 9 (code) + 1 (newline for function declaration) = 10 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

EDIT:TryItOnline!

Vitsy, 12 9 (code) + 1 (newline for function declaration) = 10 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

EDIT:

Vitsy, 12 9 (code) + 1 (newline for function declaration) = 10 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

added 65 characters in body
Source Link
Addison Crump
  • 11.2k
  • 1
  • 44
  • 90

Vitsy, 12 9 (code) + 1 (newline for function declaration) = 10 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

EDIT:

Vitsy, 12 9 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

Vitsy, 12 9 (code) + 1 (newline for function declaration) = 10 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

EDIT:

deleted 241 characters in body
Source Link
Addison Crump
  • 11.2k
  • 1
  • 44
  • 90

Vitsy, 1212 9 bytes

\o/

Expects input on STDINthe stack as the string (with a preceding quote) followed by the number, separated by newlines.

WXW2*\[vXvr]
W             Grab a line from STDIN.
 X            Remove the top item of the stack (the string placeholder)
  W           Grab the second line from STDIN (this is evaluated to a double)2*\[vXvr]
   2*         Multiply by 2.
     \[    ]  Do the stuff in the brackets that many times. (input num * 2)
       v      Take the top item off the stack and save it as a local variable.
        X     Remove the top item of the stack.
         v    Push the temporary variable back onto the stack.
          r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!TryItOnline!

Vitsy, 12 bytes

\o/

Expects input on STDIN as the string (with a preceding quote) followed by the number, separated by newlines.

WXW2*\[vXvr]
W             Grab a line from STDIN.
 X            Remove the top item of the stack (the string placeholder)
  W           Grab the second line from STDIN (this is evaluated to a double)
   2*         Multiply by 2.
     \[    ]  Do the stuff in the brackets that many times. (input num * 2)
       v      Take the top item off the stack and save it as a local variable.
        X     Remove the top item of the stack.
         v    Push the temporary variable back onto the stack.
          r   Reverse the stack.

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

Vitsy, 12 9 bytes

\o/

Expects input on the stack as the string followed by the number.

2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.

Which you can call with:

'String' r <number> 1m Z
2*\[vXvr]

This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.

TryItOnline!

added 444 characters in body
Source Link
Addison Crump
  • 11.2k
  • 1
  • 44
  • 90
Loading
Source Link
Addison Crump
  • 11.2k
  • 1
  • 44
  • 90
Loading