# Tag Info

199

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 1. Try it online.

137

///, 2*1 + 1020874 = 1020876 Prints a space.

97

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. a=[...l='14210100'],m={},s={},b={} f=c=>a.some((t,n)=>x=s[y=l.slice(n)]>t|/^[A-Z '"(]/.test(y)&&b[y],l+=String.fromCharCode(c),a.map((_,n)=>(m[x=l.slice(n)]=-~m[x])<s[y=l.slice(n,8)]||(s[...

91

Perl, 2·70525 + 326508 = 467558 Predictor $m=($u=1<<32)-1;open B,B;@e=unpack"C*",join"",<B>;$e=2903392593;sub u{int($_[0]+($_[1]-$_[0])*pop)}sub o{$m&(pop()<<8)+pop}sub g{($h,%m,@b,$s,$E)=@_;if($d eq$h){($l,$u)=(u($l,$u,$L),u($l,$u,$U));$u=o(256,$u-1),$l=o($l),$e=o(shift@e,$e)until($l^($u-1))>>24}$M{"@c"}{$h}++-++$C{"@c"}-pop@c ... 77 Python 3, 2·267 + 510193 = 510727 Predictor def p(): d={};s=b'' while 1: p={0:1};r=range(len(s)+1) for i in r: for c,n in d.setdefault(s[:i],{}).items():p[c]=p.get(c,1)*n**b'\1\6\f\36AcWuvY_v\270~\333~'[i] c=yield max(sorted(p),key=p.get) for i in r:e=d[s[:i]];e[c]=e.get(c,1)+1 s=b'%c'%c+s[:15] This uses a weighted Bayesian combination of ... 75 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 10, so this simply prints 10 which is larger than the length of the source code. You can try it here. 62 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, but import re was far too long for me. This is an anonymous function which takes in a string and outputs true/false accordingly. It uses a regex which looks for one of the following two things: ... 60 bc, 10 A Luckily, bc prints the result of the last expression by default. A is interpreted as a hex digit, so results in 10. 55 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 d=m={} s=1 w,v='',0 def f(c): global w,m,v,s,d if w not in m:m[w]={} u=m[w];u[c]=c in u and 1+u[c]or 1;v+=1;q=n=' ';w=w*s+c;s=c!=n if w in m:_,n=max((m[w][k],k)for k in m[... 47 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.8%) v+CCCCCCCCCC 32`nSSSSP Explanation v Sets the casting direction to down + Increments the casting distance by 1 ... 37 C++, 97 95 93 91 86 83 82 81 79 characters My strategy is fairly simple - an evolution algorithm that can grow, shrink, swap elements of and mutate valid sequences. My evolution logic is now nearly the same as @Sp3000's, as his was an improvement over mine. However, my implementation of the maze logic is rather nifty. This allows me to check if strings are ... 36 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 do, so thought I would post it anyway. 33 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 boring solving with a less boring, more flexible, and generally better method You run the program by compiling with csc dominoPrinter.cs and then passing ... 29 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 native tokenized encoding, but it's 4 in UTF-8...) 26 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,000,000,000,000,000,000,000,000. I guess that I tried...

25

C++, score: 2*132 + 865821 = 866085 Thanks to @Quentin for saving 217 bytes! int f(int c){return c-10?"t \n 2 sS \n - 08........ huaoRooe oioaoheu thpih eEA \n neo enueee neue hteht e"[c-32]:10;} A very simple solution that, given a character, just outputs the character that most frequently appears after the input character. Verify the ...

23

Hexagony, score 100100 Code: d!!@ In a more readable form: d ! ! @ . . . The char value of d is 100. This will simply print the char value twice and terminates after. Try it online!

22

(EDIT: This first part refers to the original phrasing of the question.) First, (!x&&!y&&!z) returns a boolean, which makes ?true:false entirely redundant. It's basically like using if (x == true) return true; else if (x == false) return false; instead of return x;. That gives you !x&&!y&&!z (EDIT: The remainder ...

21

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 used, and there are a few tricks to get better results. from collections import Counter as C, defaultdict as D R,l=range,10 s,n='',[D(C) for _ in R(l+1)] def A(c)...

20

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 order, takes the smaller of c-a and d-b, and doubles it. Why does this work? First, note that when we change an element to maximize to total cyclic sum of distances, it's optimal (or tied for optimal) to change it to equal a neighbor, ...

18

PlatyPar, 59 # # starts a numeric base-60 literal, and since no digits are found, it ends up as 59. This started as a happy accident, but since I have already [ab]used this bug in another answer, I kept it. Try it online! Here's another approach, my take on the boring way that everyone and their grandmother used for this challenge. PlatyPar, 100000000 (...

18

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 make an attempt without it, using my ancient Mathematica version 9. I managed to get it slightly shorter, though! It's a function that takes and returns a list of strings (with ., # and o as the ...

17

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 for the army transfer problem, not for the shortest game of halma I'll hopefully get to doing a proper writeup this weekend

17

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: 1e3 Score 1000 as you can see, I'm not sure it counts using the console though.

16

Python 3 + PyPy, 82 80 characters SWWNNSENESESWSSWSEENWNWSWSEWNWNENENWWSESSEWSWNWSENWEENWWNNESENESSWNWSESESWWNNESE I've been hesitant to post this answer because I've basically taken orlp's approach and put my own spin on it. This string was found by starting with a pseudorandom length 500 solution - quite a number of seeds were tried before I could break ...

16

Brainf**k, 11111111111111111111111111111111111 (~1e34) And another reduction: +++++++[>+++++++>+<<-]>>[<.....>-] Which gives 35 consecutive 1's, or approximately 1e34. A bit smaller still ++++++++[>++++++>+<<-]>+>+[<....>-] Gives 36 1's which is a number about 11% larger than 1e35. Thanks to @Martin ...

16

C, 1000000000000000000000000000 (28 digits) main(){printf("1%027d",0);} Similar to my C++ answer, without the #include <stdio.h> (Ignore the warning about missing declaration of printf. Thanks @Dennis) Newline would require an additional 2 bytes, using format 1%029d\n

16

Python 2 + PySCIPOpt, 267 bytes from pyscipopt import* R=input() m=Model() V,C=m.addVar,m.addCons a,b,c=V(),V(),V() m.setObjective(c) C(a*b<=c) P=[] for r in R: x,y=V(),V();C(r<=x);C(x<=a-r);C(r<=y);C(y<=b-r) for u,v,s in P:C((x-u)**2+(y-v)**2>=(r+s)**2) P+=(x,y,r), m.optimize() m.printBestSol() How it works We write the problem as ...

16

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 first byte missing Ignores its input; outputs the correct answer. This provides a baseline on one end; daniero provides a baseline on the other end. Builder script: #!/bin/sh if [$# -ne 3 ] then ...

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