Skip to main content
deleted 101 characters in body
Source Link
Ethan
  • 455
  • 2
  • 9

PHP, 4343 42 bytes

<?while($a=$a?rand(0,$a-1):$argn)echo$a?>
\n
\n>0

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.Try it online!

Example output:

1001912841
\n10019128410

-1 byte thanks to Titus's suggestion.

PHP, 43 bytes

<?while($a=$a?rand(0,$a-1):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1001912841
\n

PHP, 43 42 bytes

<?while($a=$a?rand(0,$a-1):$argn)echo$a?>0

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!

Example output:

10019128410

-1 byte thanks to Titus's suggestion.

Updated for `-1`. Suggested by Med.
Source Link
Ethan
  • 455
  • 2
  • 9

PHP, 4143 bytes

<?while($a=$a?rand(0,$a-1):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1001912841
\n

PHP, 41 bytes

<?while($a=$a?rand(0,$a):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1001912841
\n

PHP, 43 bytes

<?while($a=$a?rand(0,$a-1):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1001912841
\n
Updated to print the input first.
Source Link
Ethan
  • 455
  • 2
  • 9

PHP, 3941 bytes

<?while($a=rand$a=$a?rand(0,$a??$argn):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!Try it online!


This uses PHP's null coalescing operator (??) to set $a's initial value to $argn.

The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1412655551001912841
\n

PHP, 39 bytes

<?while($a=rand(0,$a??$argn))echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


This uses PHP's null coalescing operator (??) to set $a's initial value to $argn.

The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

141265555
\n

PHP, 41 bytes

<?while($a=$a?rand(0,$a):$argn)echo$a?>
\n
\n

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!


The two \ns are supposed to represent blank lines because I couldn't get them to show up any other way. They add one blank line after the output, since 0 isn't printed.

Example output:

1001912841
\n
Source Link
Ethan
  • 455
  • 2
  • 9
Loading