204
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 ...
- 195k
155
votes
108
votes
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.
...
- 176k
78
votes
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 ...
- 4,230
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, ...
- 61.3k
62
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 ...
- 70.3k
56
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
...
- 731
49
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....
- 7,299
38
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 ...
- 4,230
30
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 ...
- 11.8k
28
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 ...
- 43.9k
27
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,...
- 17.8k
25
votes
Write Moby Dick, approximately
C++, score: 2*132 + 865821 = 866085
Thanks to @Quentin for saving 217 bytes!
...
- 16.3k
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 ...
- 648
20
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:
<...
- 4,783
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 ...
- 141k
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
- 533
18
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 ...
- 3,281
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 ...
- 3,206
18
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 ...
- 2,549
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 ...
- 206
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 ...
- 14.7k
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 ...
- 4,230
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 ...
- 1,947
16
votes
Given a list of circles, output the area of the smallest containing rectangle
Python 2 + PySCIPOpt, 267 bytes
...
- 38.2k
16
votes
Write Moby Dick, approximately
sh+bzip2, 2*364106 = 728212
2*381249 + 0 = 762498
dd if=$0 bs=1 skip=49|bunzip2&exec cat>/dev/null
followed by the bzip2-compressed whale2.txt with the ...
- 3,428
15
votes
Accepted
Optimize the Scralphabet
C, 2765 (optimal)
Edit
Now all in a single C file. This just finds all the optimal solutions. They all must have 6 words of 15 letters and one 10-letter word consisting of 8 letters of value 1 and ...
- 3,717
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
optimization × 142code-golf × 61
code-challenge × 59
math × 19
array × 11
string × 9
number × 9
graph-theory × 9
fastest-code × 7
grid × 6
restricted-time × 6
combinatorics × 5
geometry × 5
sorting × 5
arithmetic × 4
path-finding × 4
python × 4
stack × 4
test-battery × 4
ascii-art × 3
sequence × 3
number-theory × 3
tips × 3
matrix × 3
atomic-code-golf × 3