2022 Developer Survey is open! Take survey.
202 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

Retina, score 1 The empty program counts the number of matches of the empty regex in the input (which is the empty string). That's exactly 1 match, so it prints ...
user avatar
150 votes

Write Moby Dick, approximately

///, 2*1 + 1020874 = 1020876 Prints a space.
user avatar
  • 18k
105 votes

Write Moby Dick, approximately

Perl, 2·70525 + 326508 = 467558 Predictor ...
user avatar
  • 2,509
101 votes

Write Moby Dick, approximately

Node.js, 2*224 + 524279 = 524727 Please refer to the change log at the end of this post for score updates. A function taking and returning a byte. ...
user avatar
  • 166k
78 votes

Write Moby Dick, approximately

Python 3, 2·267 + 510193 = 510727 Predictor ...
user avatar
76 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

Pyth, 10 T First attempt at using Pyth. Having had the question clarified, it seems 10 will be the smallest number. In Pyth the letter T starts off as the number ...
user avatar
62 votes
Accepted

Is this even a word?

Ruby, 29 bytes ->s{!s[/[^aeiou]{3}|[jqxz]/]} Hopefully I've got this right - it's my first time programming in Ruby. I actually did all my testing in Python, ...
user avatar
  • 60.9k
60 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

bc, 10 A Luckily, bc prints the result of the last expression by default. A is interpreted ...
user avatar
55 votes

Write Moby Dick, approximately

Python 3, 2*279+592920=593478 2*250 + 592467 = 592967 2 * 271 + 592084 = 592626 2 * 278 + 592059 = 592615 2 * 285 + 586660 = 587230 2 * 320 + 585161 = 585801 2 * 339 + 585050 = 585728 ...
user avatar
48 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

Fishing, score 7,958,661,109,946,400,884,391,936 1,208,925,819,614,629,174,706,176 Is this the highest non-trivial-looking score ever in a minimization challenge? (Even though it has been golfed by 84....
user avatar
  • 7,119
37 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

MATLAB, 1,000,000,000 (109) Also works with Octave disp(1e9) Never going to beat the esolangs, but just for fun, this is the smallest MATLAB/Octave will be able to ...
user avatar
34 votes
Accepted

Domino Circuits

C# - Massive, Slow, and inefficient solution Confession: wrote this solution some time ago when the question was still in the sandbox, but it's not very good: you can do better! Edit: replaced the ...
user avatar
  • 3,858
29 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

TI-84 BASIC, 120 5! ᴇ2 would score better if not for the silly UTF-8 requirement. (It's only two bytes in the calculator's ...
user avatar
  • 11.7k
26 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

Hexagony, score 100100 Code: d!!@ In a more readable form: d ! ! @ . . . The char value of ...
user avatar
  • 43.3k
26 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

C#, score 10^72 10^70 10^64 10^63 class A{static void Main(){System.Console.Write($"1{0:D63}");}} That's 1,000,000,000,000,000,000,000,000,000,000,000,000,000,...
user avatar
25 votes

Write Moby Dick, approximately

C++, score: 2*132 + 865821 = 866085 Thanks to @Quentin for saving 217 bytes! ...
user avatar
  • 16.2k
22 votes
Accepted

Check If Two or More Variables Are All Equal to Zero in JavaScript

(EDIT: This first part refers to the original phrasing of the question.) First, (!x&&!y&&!z) returns a boolean, which makes ...
user avatar
22 votes

Write Moby Dick, approximately

Python, 2*516 + 521122 = 522154 Algorithm: Yet another python submission, this algorithm calculates the most likely next letter looking at sequences of length 1,...,l. The sum of probabilities is ...
user avatar
  • 648
20 votes

Make me a minimum magic sum

Python 2, 44 bytes a,b,c,d=sorted(input()) print min(c-a,d-b)*2 Try it online! Sorts the input as a,b,c,d, in ascending ...
user avatar
  • 137k
19 votes

Hunt for discount

Python 3, 33 bytes lambda a:sum(sorted(a)[-2::-2])/2 Try it online! This is my first answer :D
user avatar
  • 533
18 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

JavaScript, score 100,000,000,000 (or 1*1011) alert(1e11) This is if using alert. Though you can get 100 000 000 times lesser score if using console: <...
user avatar
  • 4,733
18 votes

Island Golf #1: Circumnavigation

Mathematica (version 9), 165 bytes The nice, short ConvexHullMesh function that Greg Martin used was only introduced in Mathematica version 10, so I thought I'd ...
user avatar
  • 3,186
18 votes

Plight of the Concorde

88 Cities, 341 seconds runtime on NEOS In a recent paper we constructed a family of hard to solve euclidean TSP instances. You can download the instances from this family as well as code for ...
user avatar
17 votes
Accepted

Shortest 2-Player Game of Halma

The shortest game of halma is 49 moves 49 move solution Proof there is no 48-move solution Code used for this solution The code now supports pass Notice that the 47 move solution in the paper is ...
user avatar
  • 14.6k
17 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

PlatyPar, 59 # # starts a numeric base-60 literal, and since no digits are found, it ends up as ...
user avatar
  • 3,141
17 votes

Write Moby Dick, approximately

C++, 2·62829 + 318786 = 444444 To run this program, you need this file here, which must be named C. The program uses the same combination of Markov models as in ...
user avatar
  • 2,509
16 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

Brainf**k, 11111111111111111111111111111111111 (~1e34) And another reduction: +++++++[>+++++++>+<<-]>>[<.....>-] Which gives 35 consecutive ...
user avatar
16 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

C, 1000000000000000000000000000 (28 digits) main(){printf("1%027d",0);} Similar to my C++ answer, without the ...
user avatar
16 votes

Given a list of circles, output the area of the smallest containing rectangle

Python 2 + PySCIPOpt, 267 bytes ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible