Emoticon numbers!

6

1

(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!

programmer5000

Posted 2017-06-08T21:35:02.257

Reputation: 7 828

3This is easy to brute force for any language. – xnor – 2017-06-08T21:44:33.223

2@cairdcoinheringaahing highest number wins – programmer5000 – 2017-06-08T21:45:38.043

1@xnor true, but will produce intresting submissions. – programmer5000 – 2017-06-08T21:46:15.137

1Why the downvotes? This was +2 in the sandbox – programmer5000 – 2017-06-08T21:48:35.247

3@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 – Conor O'Brien – 2017-06-08T21:49:44.683

6I 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, ...). – Doorknob – 2017-06-08T22:02:33.750

1@Doorknob actually, many of the answers below use none of those. – programmer5000 – 2017-06-08T22:04:16.327

2All of which are, notably, esolangs. (And if you're counting by number of languages, the majority of them do.) – Doorknob – 2017-06-08T22:07:36.630

Is there a time limit? – MickyT – 2017-06-08T22:38:04.427

1"You must output something that matches the regex ^\d+$" - So e isn't allowed in the output at all? – Shaggy – 2017-06-08T22:40:57.000

1Quick, someone find a language in which 0/0 is Infinity. It's NaN in JS :/ – Stephen – 2017-06-09T17:58:50.257

@StephenS "You must output something that matches the regex ^\d+$" – programmer5000 – 2017-06-09T18:23:04.937

@programmer5000 Since snippets are allowed, does this mean that it could be assumed that the value returned is wrapped in a format call of some form - ie, could a snippet that outputs as 9000000000.0 or 9.00E+09 be assumed to return 9000000000? - (this would add 16+ languages onto my polyglot :P ) – Taylor Scott – 2017-06-13T04:08:46.233

@StephenS - I did it :P ; With 0/0 MATL takes input, implicitly convert to a numeric, and devides it by 0. This outputs Inf for all inputs which do not implicitly convert to 0. – Taylor Scott – 2017-06-13T17:25:13.220

Can someone tell me what J outputs for _ _? – Magic Octopus Urn – 2017-06-13T18:03:58.550

@carusocomputing I'm getting no output from that for particular string – Taylor Scott – 2017-06-14T13:30:16.580

I wonder what the lowest number would be... probably just 000 in most languages. – 12Me21 – 2018-03-03T15:49:26.473

Answers

16

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.

ETHproductions

Posted 2017-06-08T21:35:02.257

Reputation: 47 880

12

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

Taylor Scott

Posted 2017-06-08T21:35:02.257

Reputation: 6 709

1Works in APL and J. – Adám – 2017-06-08T21:56:04.000

Was this downvoted because it is a snippet,? If so, note that snippets have been allowed by the OP. If not, I fail to see why "this answer is not useful" applies. – Jonathan Allan – 2017-06-08T21:58:58.447

1Brute force for J. 9E9 (or 9e9) is the largest possible value. – Conor O'Brien – 2017-06-08T22:18:39.250

1

Works in Japt.

– Shaggy – 2017-06-08T22:30:16.073

1

Works in Perl 5 and Perl 6.

– Brad Gilbert b2gills – 2017-06-08T22:43:20.150

I'm tempted to downvote this because it's pretty much an exact copy of programmer5000's answer, but since you don't have enough rep to see deleted things yet, I'll pass on calling you out for that. Have an upvote instead ;P – HyperNeutrino – 2017-06-09T00:03:04.083

@HyperNeutrino programmer5000's answer had been down voted and deleted for the reason he answered his own challenge with a trivial solution before even waiting for answers. I think posting another solution is pretty legitimate in such a case, I mean, someone had to post this. – Uriel – 2017-06-09T01:55:36.660

@Uriel Yes; I said I'd pass on saying it's a dupe partially because this is the obvious answer and because this answerer can't see that post in the first place. – HyperNeutrino – 2017-06-09T02:59:13.780

5I believe this should be turned into a community wiki – user41805 – 2017-06-09T09:39:26.100

1Apparently this works in C# too (who knew?). – TheLethalCoder – 2017-06-09T10:53:53.883

1

As per my previous comment, I submitted a brute-forcer for this challenge, as an idea in the sandbox: https://codegolf.meta.stackexchange.com/a/12804/571

– TessellatingHeckler – 2017-06-09T17:23:02.203

@HyperNeutrino someone mentioned it in the comments on Sandbox, so that's why programmer5000 posted it, probably. – Stephen – 2017-06-09T17:52:43.473

@StephenS That would be a good explanation. Thanks. – HyperNeutrino – 2017-06-09T18:22:57.477

1I think it is safe to add R as well. – JAD – 2017-06-12T14:36:33.363

1Already on the board as JS @CraigAyre :P but thanks - I'll correct my abbreviation – Taylor Scott – 2017-06-13T12:39:43.593

1

Works in Java as well. The lowercase and uppercase letters at least, the third one with doesn't work.

– Kevin Cruijssen – 2017-06-13T13:03:42.177

9

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

Shaggy

Posted 2017-06-08T21:35:02.257

Reputation: 24 623

Explanation please. – CalculatorFeline – 2017-06-11T16:59:42.777

Explanation added, @CalculatorFeline. – Shaggy – 2017-06-12T14:21:05.443

9

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.

Uriel

Posted 2017-06-08T21:35:02.257

Reputation: 11 708

1You could also go for -.- which outputs the ASCII character code 255, and is also a relatively common emoticon. – Zack C. – 2017-06-09T18:39:35.880

@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). – Uriel – 2017-06-10T18:25:50.217

By assuming larger cells (I think 32-bit cell interpreters exist, possibly even 64-bit cells), you can get bigger values! – CalculatorFeline – 2017-06-11T17:00:36.910

@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. – Uriel – 2017-06-11T17:02:08.923

1"Languages are defined by their interpreters", so if you can find a 9999999999999999-bit interpreter, you can get 2^9999999999999999-1. – CalculatorFeline – 2017-06-11T17:03:39.350

@CalculatorFeline python's int are almost unbeatable, so surely an interpreter that uses the whole RAM for calculating this overflow design can come to trillions of bits. – Uriel – 2017-06-11T17:06:24.730

Python's integers are signed, so this would produce -1. You'd need an interpreter that wraps, finitizing the byte count. – CalculatorFeline – 2017-06-11T17:08:31.370

@CalculatorFeline I meant there could be an interpreter that tries to produce the highest possible number in case of overflow – Uriel – 2017-06-11T17:10:30.057

the contents of the tape post-execution may be used as a Turing machine's output – CalculatorFeline – 2017-06-11T17:22:24.043

4

Mathematica, 387420489

this one

9^9  

Mathematica, 3265920

9!9

J42161217

Posted 2017-06-08T21:35:02.257

Reputation: 15 931

9^9 is a larger number. – Doorknob – 2017-06-08T21:42:36.970

1yes I realised it right after I posted it :-) – J42161217 – 2017-06-08T21:44:53.617

4

05AB1E, 100! (93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000)

!т!

Try it online!

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

kalsowerus

Posted 2017-06-08T21:35:02.257

Reputation: 1 894

Ah! ! > ° I see. – Magic Octopus Urn – 2017-06-13T14:41:34.343

3

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!

James

Posted 2017-06-08T21:35:02.257

Reputation: 54 537

3

05AB1E, 10e100

°т°

Try it online!

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

Magic Octopus Urn

Posted 2017-06-08T21:35:02.257

Reputation: 19 422

6Looks like a bear face to be – ASCII-only – 2017-06-19T02:35:17.400

3

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!

RedClover

Posted 2017-06-08T21:35:02.257

Reputation: 719

1I 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 ;-) – ETHproductions – 2018-01-13T00:48:18.377

2

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.

steenbergh

Posted 2017-06-08T21:35:02.257

Reputation: 7 772

2

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

Fatalize

Posted 2017-06-08T21:35:02.257

Reputation: 32 976

2

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.

quat

Posted 2017-06-08T21:35:02.257

Reputation: 1 211

1

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

Skidsdev

Posted 2017-06-08T21:35:02.257

Reputation: 9 656

1

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)

L3viathan

Posted 2017-06-08T21:35:02.257

Reputation: 3 151

1

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

Taylor Scott

Posted 2017-06-08T21:35:02.257

Reputation: 6 709

Is this some kind of integer overflow? – programmer5000 – 2018-07-03T18:22:49.907

@programmer5000 I honestly have no idea - its so weird and there is nothing in the documentation about it

– Taylor Scott – 2018-07-03T18:23:50.267

-1

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

Taylor Scott

Posted 2017-06-08T21:35:02.257

Reputation: 6 709

3"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. – programmer5000 – 2017-06-13T17:33:17.817

2Noncompeting is reserved for interpreters written after the challenge date, this is not valid at all – ASCII-only – 2017-06-19T02:40:24.117