5
\$\begingroup\$

(related)

Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$, as in only 0-9.

The Twist

Your source code must be:

  1. Same forwards and backwards

  2. 3 bytes long

  3. The middle byte must be different from the other two

Example valid:

0_0
)-)
m.m
xvx
W$W
@\@

Example invalid:

mnop
l__l
___
T_+
O_o
0_o

Snippets are allowed, you don't need a full program / function.

Highest number outputted wins!

\$\endgroup\$
  • 3
    \$\begingroup\$ This is easy to brute force for any language. \$\endgroup\$ – xnor Jun 8 '17 at 21:44
  • 2
    \$\begingroup\$ @cairdcoinheringaahing highest number wins \$\endgroup\$ – programmer5000 Jun 8 '17 at 21:45
  • 3
    \$\begingroup\$ @programmer5000 Perhaps because its trivial, boring, and leaves little room for interesting solutions? I haven't voted on it, but this might be why it stands currently at +1/-4 \$\endgroup\$ – Conor O'Brien Jun 8 '17 at 21:49
  • 6
    \$\begingroup\$ I downvoted because there are so few possible answers that it's impossible to be at all imaginative, and for most languages the optimal answer is the same (989, 9^9, 9e9, ...). \$\endgroup\$ – Doorknob Jun 8 '17 at 22:02
  • 2
    \$\begingroup\$ All of which are, notably, esolangs. (And if you're counting by number of languages, the majority of them do.) \$\endgroup\$ – Doorknob Jun 8 '17 at 22:07

16 Answers 16

15
\$\begingroup\$

Jelly, 103000

ȷ*ȷ

Try it online!

How it works

ȷ denotes an scientific-notational number, as in 2ȷ6 for 2000000. Without digits on either side, it defaults to a value of 1000. * is exponentiation, giving 10001000.

\$\endgroup\$
11
\$\begingroup\$

Polyglot (26 Langs), 9000000000

Works With:

APL, AWK, Arcyou, C#, CJam, Convex, Excel, Google Sheets, J, Japt, Java, JavaScript, MATL, MATLAB, Perl 5, Perl 6, PHP, PowerShell, Python, R, RProgN, TI-BASIC, VB, VB.NET, VBA, VBScript

This is a polyglot, if it works in your language add it to the list

9e9

or

9E9

or (Pretty much only for TI-BASIC)

9ᴇ9

Try it Online. (VB.Net)

(dependant on language)

  • Added APL and J thanks to @Adám
  • Added Python thanks to @VoteToReopen
  • Added Japt thanks to @Shaggy
  • Added Perl 5/6 thanks to @bradgilbertb2gills
  • Added PowerShell thanks to @tessellatingheckler
  • Added C# thanks to @TheLethalCoder
  • Added Visual Basic Family
  • Added R thanks to @JarkoDubbeldam
  • Added AWK, Arcyou, CJam, Convex, MATL, MATLAB, PHP, RProgN, TI-Basic
  • Added Java thanks to @KevinCruijssen
  • Added Excel and Google Sheets

Note: With formatting, supported by: Clojure, Common Lisp, Crystal, D, Go, Haskell, Java, Julia, Kotlin, Lua, Maxima, NIM, Racket, Rexx, Ruby, Rust, Scala

\$\endgroup\$
  • 1
    \$\begingroup\$ Works in APL and J. \$\endgroup\$ – Adám Jun 8 '17 at 21:56
  • 1
    \$\begingroup\$ Brute force for J. 9E9 (or 9e9) is the largest possible value. \$\endgroup\$ – Conor O'Brien Jun 8 '17 at 22:18
  • 1
    \$\begingroup\$ Works in Japt. \$\endgroup\$ – Shaggy Jun 8 '17 at 22:30
  • 1
    \$\begingroup\$ Works in Perl 5 and Perl 6. \$\endgroup\$ – Brad Gilbert b2gills Jun 8 '17 at 22:43
  • 5
    \$\begingroup\$ I believe this should be turned into a community wiki \$\endgroup\$ – Kritixi Lithos Jun 9 '17 at 9:39
8
\$\begingroup\$

Brainfuck, 255

-+-

Assuming 8-bit bounded cells.


Per this meta consensus, the contents of the tape post-execution may be used as a Turing machine's output.

\$\endgroup\$
  • 1
    \$\begingroup\$ You could also go for -.- which outputs the ASCII character code 255, and is also a relatively common emoticon. \$\endgroup\$ – Zack C. Jun 9 '17 at 18:39
  • \$\begingroup\$ @ZackC. I thought about it, but . will print ÿ where the question demands matching \d+. outputting through tape contents seemed to oversee this because it uses numbers (until printed). \$\endgroup\$ – Uriel Jun 10 '17 at 18:25
  • \$\begingroup\$ By assuming larger cells (I think 32-bit cell interpreters exist, possibly even 64-bit cells), you can get bigger values! \$\endgroup\$ – CalculatorFeline Jun 11 '17 at 17:00
  • \$\begingroup\$ @CalculatorFeline yea, but then I can claim for 1024, 2048, 4096... and there's no end (storage boundaries are not assumable). so I took on the common specs (and implementations) that lists 8 as a default when one exists. \$\endgroup\$ – Uriel Jun 11 '17 at 17:02
  • 1
    \$\begingroup\$ "Languages are defined by their interpreters", so if you can find a 9999999999999999-bit interpreter, you can get 2^9999999999999999-1. \$\endgroup\$ – CalculatorFeline Jun 11 '17 at 17:03
8
\$\begingroup\$

Japt, 1.001001001001001e+299 = 100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100

Found a bigger one thanks to ETHproductions informing me that strings were permitted.

LçL

Try it


Explanation

  • L is the Japt constant for the number 100.
  • The ç method, which takes string s as an argument, when applied to a number n, repeats s n times. If a number is passed as the argument, it's cast to a string.
  • So, reading LçL backwards, it's "100 repeated 100 times".

Original, 10200

LpL

Try it

\$\endgroup\$
  • \$\begingroup\$ Explanation please. \$\endgroup\$ – CalculatorFeline Jun 11 '17 at 16:59
  • \$\begingroup\$ Explanation added, @CalculatorFeline. \$\endgroup\$ – Shaggy Jun 12 '17 at 14:21
4
\$\begingroup\$

Mathematica, 387420489

this one

9^9  

Mathematica, 3265920

9!9
\$\endgroup\$
  • \$\begingroup\$ 9^9 is a larger number. \$\endgroup\$ – Doorknob Jun 8 '17 at 21:42
  • 1
    \$\begingroup\$ yes I realised it right after I posted it :-) \$\endgroup\$ – J42161217 Jun 8 '17 at 21:44
3
\$\begingroup\$

Vim, 999999999

9i9

Since snippets are allowed, this works in vim as well as V, so you'll have to hit escape after this.

Try it online!

\$\endgroup\$
3
\$\begingroup\$

05AB1E, 100! (93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000)

!т!

Try it online!

т is the constant 100 and the first ! is just ignored.

\$\endgroup\$
  • \$\begingroup\$ Ah! ! > ° I see. \$\endgroup\$ – Magic Octopus Urn Jun 13 '17 at 14:41
3
\$\begingroup\$

05AB1E, 10e100

°т°

Try it online!

also it looks more like a uterus than a face...

\$\endgroup\$
  • 6
    \$\begingroup\$ Looks like a bear face to be \$\endgroup\$ – ASCII-only Jun 19 '17 at 2:35
3
\$\begingroup\$

Japt, 2550

#ÿ#

3 bytes in extended ASCII, where ÿ has code 255. # gets it's code and returns it, while the second # returns simply 0, because nothing follows it.

Try it online!

Japt, 91

Really bad score. That's just an experiment

;I;

Try it online!

;I;
;   Alternative variables mode
 I  Constant for 91
  ; Command separator - does nothing

Japt, ~1e+102 (cheating?)

Probably not valid answer, because Japt is transpiled to JS which automatically converts numbers to scientific notation.

LeL

It's basically 100^100.

Try it online!

\$\endgroup\$
  • 1
    \$\begingroup\$ I don't see why XeX would be cheating; 9e9 is the best possible answer in a number of languages, including JS. And even if scientific notation was cheating, this technically isn't using it, because e is actually a method here, multiplying the first number by 10 to the second ;-) \$\endgroup\$ – ETHproductions Jan 13 '18 at 0:48
2
\$\begingroup\$

QBIC, 10

?z?

The challenge specifically asks to "output" the number, and the only way to do that in QBIC is using ?. So this prints z (which is 10 in QBIC) followed by 2 newlines.

A slightly more relaxed take on the rules would give us this snippet:

z^z

which is good for 10,000,000,000. It doesn't output anything (in fact, it doesn't even assign the result), but as a 3-byte ABA snippet it reaches the highest number possible.

\$\endgroup\$
2
\$\begingroup\$

Brachylog, 39916800

ḟjḟ

Try it online!

Explanation

ḟ      Factorial: the Input is a free variable, so it considers that its input is 0
 j     Juxtapose: 11
  ḟ    Factorial: 39916800
\$\endgroup\$
2
\$\begingroup\$

Psi, 99980001

Spell

Not super inventive. And it's probably cheating.

I'd love to use Operator: Power instead, but the "base" and "power" arrows are different colors, making it not symmetrical.

\$\endgroup\$
1
\$\begingroup\$

Braingolf, 126

#~#

Try it online!

Yep, that's as high as Braingolf can go under these restrictions.

Explanation:

#~   Pushes codepoint of ~ (126)
  #  Does nothing
     Implicit output of last item on stack
\$\endgroup\$
1
\$\begingroup\$

Aceto, 387420489

Since snippets are allowed,

9F9

may push 9^9 on the stack, depending on where in the code it is. An example of it working would be:

 9F9
   p

(the p merely prints, you could replace it with a nop and it would still work)

\$\endgroup\$
1
\$\begingroup\$

Yabasic, 2^1024

I have no idea why, but it works. See the TIO link

0/0

Try it online!

Note: the Print command converts any number with a length greater than 10 digits to scientific notation, so a Using command is used to print the value without converting it to scientific notation

\$\endgroup\$
  • \$\begingroup\$ Is this some kind of integer overflow? \$\endgroup\$ – programmer5000 Jul 3 '18 at 18:22
  • \$\begingroup\$ @programmer5000 I honestly have no idea - its so weird and there is nothing in the documentation about it \$\endgroup\$ – Taylor Scott Jul 3 '18 at 18:23
-1
\$\begingroup\$

MATL, 9000000000

An anonymous and rather boring function that takes no input and outputs 9000000000

9e9

which scores 9000000000

Try it Online

Far more Interesting, but cheaty approach

Takes input and implicitly converts it to a numeric value which it divides by 0, which, for almost any input returns Inf (Infinity) which does not fit the regex requirement

0/0

Try It Online

I tested 47 languages over 3 hours to find this

\$\endgroup\$
  • 3
    \$\begingroup\$ "You must output something that matches the regex ^\d+$, as in only 0-9.". Also, submissions must not require input unless the challenge specifies that. \$\endgroup\$ – programmer5000 Jun 13 '17 at 17:33
  • 2
    \$\begingroup\$ Noncompeting is reserved for interpreters written after the challenge date, this is not valid at all \$\endgroup\$ – ASCII-only Jun 19 '17 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.