Skip to main content
fix extra quotes and extra output, save two bytes thanks to Dennis
Source Link
Setop
  • 198
  • 7

CJam, 1919 17 bytes

"a""b"'a'b{_@_p\+_@_n\+}ri*;pri*;;

explanation

"a": putPush character literal "a" ononto the stack.
"b": putPush character literal "b" ononto the stack.
{_@_p\+}
    {: Block begin.
    _: duplicate top element on the stack
    @: rotate top 3 elements on the stack
    _: duplicate top element on the stack
    pn: print string representation and newline
    \: swap top 2 elements on the stack
    +: add, concat
    }: Block end.
r: read token (whitespace-separated)
i: convert to integer
*: multiply, join, repeat, fold (reduce)
;: pop and discard
p;: print string representationpop and newlinediscard

CJam, 19 bytes

"a""b"{_@_p\+}ri*;p

explanation

"a": put "a" on stack
"b": put "b" on stack
{_@_p\+}
    {: Block begin.
    _: duplicate top element on the stack
    @: rotate top 3 elements on the stack
    _: duplicate top element on the stack
    p: print string representation and newline
    \: swap top 2 elements on the stack
    +: add, concat
    }: Block end.
r: read token (whitespace-separated)
i: convert to integer
*: multiply, join, repeat, fold (reduce)
;: pop and discard
p: print string representation and newline

CJam, 19 17 bytes

'a'b{_@_n\+}ri*;;

explanation

"a": Push character literal "a" onto the stack.
"b": Push character literal "b" onto the stack.
{_@_p\+}
    {: Block begin.
    _: duplicate top element on the stack
    @: rotate top 3 elements on the stack
    _: duplicate top element on the stack
    n: print string representation
    \: swap top 2 elements on the stack
    +: add, concat
    }: Block end.
r: read token (whitespace-separated)
i: convert to integer
*: multiply, join, repeat, fold (reduce)
;: pop and discard
;: pop and discard
added 578 characters in body
Source Link
Setop
  • 198
  • 7

CJam, 19 bytes

"a""b"{_@_p\+}ri*;p

explanation

"a": put "a" on stack
"b": put "b" on stack
{_@_p\+}
    {: Block begin.
    _: duplicate top element on the stack
    @: rotate top 3 elements on the stack
    _: duplicate top element on the stack
    p: print string representation and newline
    \: swap top 2 elements on the stack
    +: add, concat
    }: Block end.
r: read token (whitespace-separated)
i: convert to integer
*: multiply, join, repeat, fold (reduce)
;: pop and discard
p: print string representation and newline

CJam, 19 bytes

"a""b"{_@_p\+}ri*;p

CJam, 19 bytes

"a""b"{_@_p\+}ri*;p

explanation

"a": put "a" on stack
"b": put "b" on stack
{_@_p\+}
    {: Block begin.
    _: duplicate top element on the stack
    @: rotate top 3 elements on the stack
    _: duplicate top element on the stack
    p: print string representation and newline
    \: swap top 2 elements on the stack
    +: add, concat
    }: Block end.
r: read token (whitespace-separated)
i: convert to integer
*: multiply, join, repeat, fold (reduce)
;: pop and discard
p: print string representation and newline
Source Link
Setop
  • 198
  • 7

CJam, 19 bytes

"a""b"{_@_p\+}ri*;p