Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's

Explanation

Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=-~a;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine and increments at the same time.

$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

This is the quine part. We essentially repeat the quine string by the counter+1. Subsequent function calls will override the output.

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=-~a;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine and increments at the same time.

$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

This is the quine part. We essentially repeat the quine string by the counter+1. Subsequent function calls will override the output.

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655!

Explanation

Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=-~a;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine and increments at the same time.

$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

This is the quine part. We essentially repeat the quine string by the counter+1. Subsequent function calls will override the output.

added 30 characters in body
Source Link
Mama Fun Roll
  • 10k
  • 1
  • 38
  • 47

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=a||1;a=-~a;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine and increments at the same time.

$=_=>`var a=a||1;$=$a=-~a;$=${$};$();`.repeat(++aa+1);$();

This is the quine part. We essentially increment the counter and repeat the quine string based onby the countercounter+1. Subsequent function calls will override the output.

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=a||1;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine.

$=_=>`var a=a||1;$=${$};$();`.repeat(++a);$();

This is the quine part. We essentially increment the counter and repeat the quine string based on the counter. Subsequent function calls will override the output.

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=-~a;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine and increments at the same time.

$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

This is the quine part. We essentially repeat the quine string by the counter+1. Subsequent function calls will override the output.

added 22 characters in body
Source Link
Mama Fun Roll
  • 10k
  • 1
  • 38
  • 47

Javascript ES6 REPL(REPL), 5755 bytes

var a=a||1;$=_=>`vara=-~a;$=_=>`var a=a||1;$=$a=-~a;$=${$};$();`.repeat(++aa+1);$();

Here we go...Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=a||1;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine.

$=_=>`var a=a||1;$=${$};$();`.repeat(++a);$();

This is the quine part. We essentially increment the counter and repeat the quine string based on the counter. Subsequent function calls will override the output.

Javascript ES6 REPL, 57 bytes

var a=a||1;$=_=>`var a=a||1;$=${$};$();`.repeat(++a);$();

Here we go... #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=a||1;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine.

$=_=>`var a=a||1;$=${$};$();`.repeat(++a);$();

This is the quine part. We essentially increment the counter and repeat the quine string based on the counter. Subsequent function calls will override the output.

Javascript ES6 (REPL), 55 bytes

var a=-~a;$=_=>`var a=-~a;$=${$};$();`.repeat(a+1);$();

Saved 2 bytes thanks to @user81655! #Explanation Here's the standard quine framework:

$=_=>`$=${$};$()`;$()

You should be able to see this framework inside the submission. More explanation below.


var a=a||1;

This is the counter, defaulted to 1. Basically, it tells us how much to repeat the quine.

$=_=>`var a=a||1;$=${$};$();`.repeat(++a);$();

This is the quine part. We essentially increment the counter and repeat the quine string based on the counter. Subsequent function calls will override the output.

REPL because it requires implicit out
Source Link
Downgoat
  • 29.2k
  • 6
  • 85
  • 157
Loading
added 7 characters in body
Source Link
Mama Fun Roll
  • 10k
  • 1
  • 38
  • 47
Loading
Source Link
Mama Fun Roll
  • 10k
  • 1
  • 38
  • 47
Loading

AltStyle によって変換されたページ (->オリジナル) /