# Output two numbers (Cops' thread)

The challenge here is very simple. Create two programs of the same size, in the same language, which output (using 1 standard output method) two different natural numbers, $$\x\$$ and $$\y\$$. Submit both programs, both numbers and the language used in an answer on this thread.

Robbers will then attempt to find a program in the same language which outputs a number in between $$\x\$$ and $$\y\$$, and is the same length as or shorter than your programs. If they do, they will post it to the robbers' thread, and it is "cracked".

For example If I post:

# Haskell, $$\9-7 = 2\$$, 12 bytes

main=print 7

main=print 9


Then robbers must find a program that prints 8 in 12 bytes or fewer.

Unlike many challenges in cop's do not need to have an answer in mind when posting. It is perfectly valid to post an answer which cannot be cracked at all. In fact that is incentivized. However the scoring means that the better you score the harder it will be to prevent a crack.

## Scoring

Your score will be the difference between $$\x\$$ and $$\y\$$. So in the example answer it was $$\2\$$. Higher score is better. If your answer is cracked it's score is automatically set to 0.

Since there is no hidden information that needs to be revealed, answers will not be marked as safe. You get your score as soon as you post the answer and it will remain your score until someone cracks it.

• If our language allows us to output an infinite number (R can output Inf, for instance), is a program that outputs this acceptable (for an infinite score if uncracked)? Jan 31 at 12:07
• @DominicvanEssen I would argue that 2e308 theoretically refers to Inf not an integer. So it's clear to me that this is a subjective measurement. Your answer should be correct given enough memory. Jan 31 at 12:20
• You say "program" in the challenge description - must answers be full programs, or are functions acceptable? Also, must both programs use the same output method, and must robbers' posts also? (I would suggest saying they must) Jan 31 at 16:55
• @DewiMorgan That's fine but you score very low, so I don't think it's even worth it. Jan 31 at 19:15
• Does the robber's number need to be natural? For cops it's specified explicitly, but not for robbers. Jan 31 at 19:16

# Zsh, 1 byte, score 124, provably uncrackable

Programs output via exit code.

/

Outputs 126 ("permission denied"). Attempt This Online!

[

Outputs 2 ("invalid argument"). Attempt This Online!

Here is a script which tests all 256 possible 1-byte programs, which you can use to verify that this is uncrackable (and unbeatable for 1-byters):

{ for c ({0..255}) ( zsh -c ${(#)c} &>/dev/null; echo$? ) } | sort -n

Attempt This Online!

The empty program exits with 0.

# Malbolge, 7 bytes. Score: 3 - 1 = 2. Cracked.

D'<;_L"


Outputs 3.

(&a%M"o


Outputs 1.

• That's some Seedprogrammer craziness.
– null
Jan 31 at 11:29
• @null OH! thanks for the hint. Jan 31 at 11:31
– null
Jan 31 at 11:32
• Cracked!. That was not very easy. Feb 2 at 0:16
• @DominicvanEssen very cool! Feb 2 at 7:47

# R, 5 bytes, score: 10^307

1e308


Try it online!

9e307


Try it online!

2e308 overflows R's numeric type, and outputs Inf, so I suppose that 1e308 is the highest number that we can output using 5 bytes.

# R, 4 bytes, score: 9 x 10^98, cracked, almost instantly

1e99


Try it online!

1e98


Try it online!

Note after crack: Well, that was pretty stupid of me.

• Cracked but the question suggests to better make uncrackable solutions
– l4m2
Jan 31 at 11:40
• @i4m2 - Oh, that was stupid of me. Jan 31 at 11:41
• Note that 3^ceiling(log(9e307,3)) (and variants) are bigger than 1e308, so those are dead ends. Jan 31 at 15:39
• @Giuseppe - Hm, so I was clearly wrong about 'the highest number that we can output using 5 bytes' then... Jan 31 at 15:45
• @Giuseppe - (and now I'm quite curious what would be the shortest expression that would output 1.797693e+308, assuming that this actually is the highest number that can be output in R...) Jan 31 at 15:49

# C, 24 bytes, score 33482810471

Output format is decimal.

main(){printf("%o",~9);}


Outputs 37777777766. Try it online!

main(){printf("%u",-1);}


Outputs 4294967295. Try it online!

Uncrackable?

• it's like here, often cracked by main(){printf("%o",.2);}, but not always.
– user111777
Apr 5 at 7:31

# Excel, 10 bytes, score (145!)-(144!) 0 Cracked!

I'm interested to see how this can be cracked.

=FACT(145)

Outputs 8.04792605747199E+251 (actually prints every digit when in "Number" format and a very wide column/merged columns, the most I could get it to print before they became ##### or #NUM!

=FACT(144)

Outputs 5.55029383273931E+249 (again, actually prints every digit [although it does turn most to 0's])

But... if you think it's okay if I can use un-printable numbers (likely not)

# Excel, 10 bytes, score (999999999!)-(999999998!)

=FACT(999999999)


Output is approximately 1e8448735636

=FACT(999999998)


Output is approximately (1e8448735636)/999999999

• Welcome to Code Golf! Nice answer. Feb 1 at 2:13
• Thanks! Can I post another answer for another language (C)? Feb 1 at 2:19
• Sure! Posting multiple answers is fine unless the challenge specifically says not to, even in the same language if they're different enough. Feb 1 at 2:28
• cracked! Feb 1 at 10:41
• (and I assume the dodgy un-printable one is a typo, otherwise surely =FACT(100000001) is a crack...?) Feb 1 at 11:06

# Charcoal, 2 bytes, score: 1000 - 99 = 901

Ｉφ


Outputs 1000. Try it online! Link is to verbose version of code.

99


Outputs 99. Try it online!

# Jelly, $$\1000 - 256 = 744\$$, 1 byte

This is provably uncrackable. Our programs are

ȷ


Try it online!

and

⁹


Try it online!

These are the following one byte programs in Jelly that output a number:

¤¥¬®µ½×ðȷ !$&*+-.0123456789<=>ACEHLNOPSX^_aceghinoquvw|~°¹²³⁴⁵⁹⁻⁼ẠḄḌẸḤỊṂṆẒȦḂĊḞḢṀṠṪạḅḍịḳḷṇṛ§ẉỵẓȧċḋėġṅȯẇẏ«»‘’  Try it online! The two largest outputs are $$\1000\$$ with ȷ, then $$\256\$$ with ⁹. Nothing else outputs something in between, and the empty program outputs 0. # Vyxal 2.8.1, online edition, Score: $$\no\$$, 102 bytes - cracked Our two programs are: kḭkḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(kḭ(↵  which is equivalent to: stack.append(4294967296) for i in range(4294967296): for j in range(4294967296): for l in range(4294967296): ... stack.append(10 ** stack.pop())  and k×k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(k×(↵  stack.append(2147483648) for i in range(2147483648): for j in range(2147483648): for l in range(2147483648): ... stack.append(10 ** stack.pop())  These both output really big numbers, which I need to calculate. Online edition here means that it should be able to work on the online version of the interpreter if given enough resources and time. • From the description this seems like it should be really easy to crack. Simply write a program which loops a set number of times each time applying ↵. Start at 8 and you should have plenty of room to add 1 at the end. But I don't know enough about lyxal to make this happen. Jan 31 at 12:30 • @WheatWizard by the time you've set up the loop, you've already wasted a potential ↵ that could have been used instead Jan 31 at 12:32 • I'm pretty sure you can set up a loop in fewer than 1000 bytes giving you plenty of time to apply ↵ way more than the program which just naively applies ↵ repeatedly. There is just so much room. Jan 31 at 12:34 • @WheatWizard "I don't know enough about lyxal to make this happen" lol Jan 31 at 12:37 • I doesn't know much about vyxal either bot doesn't something like eval("kḭ" + "kḭ("*98 + "↵")+1 is possible with fewer bytes in this language? Jan 31 at 12:47 ## Seed 4791 bytes, 9^9^9^9^9^9^9^9^9^9^9 - 9^999 9^999: 36 94981479280208146944953816764699944095961978453221682715159791056688140996853888504437229889191975183564015323273899198344481103250895668467924054339223701930305051118652741561583994582158440585564368286547479926974178096702473601294217332487135194413906552257837173590043556058790275467394479137424662603752651645938216669070115921033298764330851330467996807939281657656425699237251690473743679487474871854542411596819130830481224340562767172942708101325192086341055751991333028615416686839981817142945819118242545846019740984523396598771709676467792891959285529685021033906795910583508008242630927336057598688291102981549916746769870319488733952651891371543582899041173842586806720961829689851873808965388202504531747804845840143327859796447099370149069303515672221742322125494895020945918848068614407697751238250677431155329740069260038983064746127731524766636439066019193467422893766041808161143968190057861269526918372578995949004970306694838999565427329694454909226376047136625534400886807619996259128667499478409012349612038652572951348047086088817551011308002652053644287503036935028935844715426527836055671911027719964392826069078969082698559771882396772799751373195780148811909716528980696256380945795001274573193459618177342958415946401666965464920052072906030975414694315792619540688825293711591412127002343225335880571865520167604325308977304908296745198902342257861540933487039862994356564924690417285711172056255742252487361407255067571158083586073346420212617420441279183030666063290178409730490381049078147916881460523911120507498436875929418470544681759185903900133455626013012351989728905311148323498044351461599265083429729804099930581137436822766380518345367947616841345549577232164529955502684122270790499052240935152809235771171370434070236688989688479953925955276348719434668321141480227864703028324596206817015011573827251621510788266231733052888294086085254666969188534237535939663347385652634046245668458458194635071661213214973469115822380087405654270393830651870914063112038485264582625501640551679797243637993058707669484199371425261416836151503596151478053438581656553121438841132537636618059562148278640553730409617733965555456279846109188629372980642417837804453861796471345795684171211276475918979481722058104857844758843603165344900677433585454487342231624372104550191735735796454388857238022368193594741972999621272782164771208619698294562775042889372442244124800173695001811951104483064798795939319310120564380578007164764614616015236574253569882284714066981102630472310220979239145467130016229967089894017391315803929147667149546926923076190028432304251122963960242247834461462078725734648747107996037476017483441942628448413731020112504750795380529669192191584807395775799602140589910229189049503739591898879818034929487479963008540786045617483659914745637538236332799035903698998398005069763801222822678189343269224348393728495631906613048781189537304930344768279627715649280517720235827779507044205103495831324708746293837927334289124220386247007983741488271118125085904363197981352562772119852399632426650691964453022658894369910133959424146640109164371294689079802777902307296880648093189854866622499839863241317182736088299334215289137396403643588453171937501380801955934324623689028726948232299713278675563351730787914169555473591390989160245212337001718142110638979369841824007070047204941161283902352728852331043554053279968108315668988738506810443190205259224591564532510273789237748335782790807545071073495745130501275790665780813262239133252704358246589268608658852890888957950256512957031746836236764704856568474359369600518287601870385217873471559723711460790851490641852774919778389159824024349093647531524452566965015853360104186115940302479291089022327363165427092882556283691659718308627299377279772911302647604701234001616842762253575818861145567617316017544857744939000573784180397907315361706557618352235994622697878150716754864959319585660748889125094235883962411794008488384621978956654775262754623280713877112553348864910614097062301093879722439179562871939066598227413212667524976059454125001698534620701802564422768614905506319489756942407153064671390062115508534001167416000467035978170537796335329422124742348973353594178675864912238921028339003101191208960656005489477745423235808264714405884454620918978113027106595440238470298437388674769792190539877475662105937286759309442118449241650440411271188409657695505912558859008915175033843314270463991607598704331221534023888995395090620691204768  This generates the following befunge programs:  "cb 0=HTGNEL_ENIL_CB|'999^9' ohce"=@  Thanks to @null for reminding me I know how to program Seed. The second program becomes: 53 309587622060800553797768779768494911841628261184767731489332912878541825672886566188681588715091427880831872903145865614752063676670384244697938284581157766493625127486069966517483807267622940281840537784840565165614923074081025668091978619573378790644656852906050466371773524417205893183522285682501264293869247195711547240624794051171506566110127196684091043263704047601080904572252690239932534180485242573593166277713560062201443018547580753558753076249237708886730792578837512812594738578149293808173180907025198002544953022811343070481719591552371661589667292782400655709462087966594005437890287977681252692413309430402819975448488893242566687723971049600796250960915479240241523929324115544908597729425622791811471173026530746268048270787941195246863033941763322474063945991208609412842541131320624405655371178829432647519162966803019160693234110850310536828203057708491223327429158504206916042083919635627816797751112595799425150793221319690691484648035817244488524453691950153293122568235889159354407000681042368350613187209832365401659548342971503410960096851577419002008732886164772578445903853439006453593714967313295474365940623318333595448104799161502690614815839414921869269173019141656145770493252423864457874164529445010976172453560422794168628767033007798464857807868972770119452458362389906963282436285266581231736927418149622919396524509045600877152139736196549699718010709692427212834211798096407951361607408561365539352799316609116886495092220026475056054004109655559238156190632938794875725763241934373532462961173950124119350519950416535961630182879968505149425984423718446515752555953370146281257558975704887791656829772389610358616172108023688683194195646087461491617635517077426354405251289450350884001525808934031920441467238068082960111819700136750591936811451950869796830795917902563838207457238199783664676631034747422610392737824936385217739329722785171995265543924626358418544733893242621181268907981435590946535967453087735571432009511302485790035630081692234070829135516653019636470143030262426164209059107313322273527988454852167740639604116654661106183147469766915633812512660623654733210776980513357988371975078629660700128024350111565369418799322994425194707442766131638194451296869655903560930552909726193906116203105280133098173487874636694252312563326834465786203019871459621428412218125660006856353034700431931551987177749720765277804188429325209144778878250052168648774014287051224303669581052487796035601212899803091980714662821531796312403019296375399485542097354585848372838776512451340890861805997089465652085241774190551963641174852103085029950949878525880282522636862689978529309241328139079974474498840789713396190657697469158669210302848644464901861283874879947038142675120700972350655160123482902871840054575564022314230414143498863246180321421107093159843511652846289238887904021891711361912352395752690348787554827002831376719081050720410310253594459120692911078678989959842508193061754966247315287630553272097166145570047781427011192833631466194493500860462029105164607250519256275264184570393514673731241768380866974597977047998254748735616785609554132052392767706860844358763762550597658505611387104158401413665230304581335849536972107107380977005367190725149287488469722296267278310609063864272116083546208401737358229303260037829564529791746229429584305623876048177048606434240808955564817647762135226292996457376569825840317487337230342808888439404782377044367241171285682843079144996791352785027653912966489528982369346460394462814510925432325649339476445012957862795528485420766725202232921562144249478994398630291247115812027459339439917745701011664764129641934911394405527525162982448137755434800132266423495736646406665020110921399145992639873000772187319349501446035997970338236156282496731462537470287250998341901639931110985832053143995593295587994998629729807528492791923904555457866017778430904246471024077597359827409642434169201834219584106992783524218181235229797375275600542981388826320938305229269139948945723602080721878638825973118853705899013952011812734028557886010265443351247058659869796789367980202658727913440606028570394873456111539589719778807886159735916680268655045949064003143304502567591948483646514438384066523522818325855415617165015245093826574834982063177898711249371505888565014662311628585433493237461213627490980308832056414074306954654643982609793175536357731519819711214704220198179035754939835716988611721494310455897591499137450735143359976295914194929864424760941191508944873123510109598842071064171881097121958831073339652141908077795821260390971306588642697066016462777462135092080108211612548519054989094919411477432604519350786361891036501628076178403464320215611778222267688190891672404404679274514697484921192422288645990934995323948756777118204678605373179302677235930726235223857  The first one can be padded with spaces to it's length. It expands to the following: "cb 0=HTGNEL_ENIL_CB|'9^9^9^9^9^9^9^9^9^9^9' ohce"=@  The score: $$\10^{10^{10^{10^{10^{10^{10^{10^{10^{8.567841344463465}}}}}}}}}\$$ • oh oops... you've seen nothing. Jan 31 at 12:18 • @WheatWizard it's a mildly theoretical submission. It's just bc doing all the computations behind the hood, judging by the Befunge code it generates. You probably don't have enough memory to generate the bigger number. Jan 31 at 12:34 • @WheatWizard you didn't crack my answer, I wrote this code. I don't think it's fair to claim it under your name. If anything, I cracked my solution myself. (accidentally) Jan 31 at 12:52 • You didn't crack it :). And I refuse to acknowledge the crack. Jan 31 at 12:58 • I agree with Wheat Wizard here that this answer is cracked since there is a program that fulfills the requirements of cracking it. It acknowledges Kamila as the cracker, which is fine. Feb 2 at 18:29 # Zsh, 13 bytes, score $$\ \approx 10^{(21 \times 10^6)} \$$ tr<=go -c 9 9  Outputs 13061918 9s. Try it online! tr<=z3 -c 1 1  Outputs 21366224 1s. Try it online! Exact score: $$\frac{10^{21366225} - 1}9 - 10^{13061919} + 1$$ ## Explanation • <=go: load the program go, as a file • tr -c 9 9: replace all characters except 9, with 9s The other program is similar. z3 and go are the largest 2-character programs available on TIO, at about 22MB and 14MB respectively. We can use them as an easy source of very long "strings", and by converting all the bytes to digits, very large numbers. I used TIO instead of ATO because it has much bigger binaries available, and also because ATO is too frequently updated, changing the binaries, so the score would change over time. I'm not intending for this to be cracked, but I haven't tried very hard to ensure there aren't any cracks. # Brachylog, 5 bytes, score = 61803398875 - 14159265359 = 47644133516 φṫb₂ị  Try it online! πṫb₂ị  Try it online! ### Explanation Not sure this is crackable: φ Take Phi = 1.61803398875 π Or Pi = 3.14159265359 ṫ Convert to string b₂ Remove the first digit and the decimal separator ị Convert back to integer  • Cracked? Jan 31 at 16:24 # Brainf*ck, 25 bytes. Score = 7 - 4 = 3, cracked by Fmbalbuena >>+++++[<+++++++++++>-]<.  ^ Outputs 7 >++++[<+++++++++++++>-]<.  ^ Outputs 4 I just learned Brainf***, I think it's going to be an easy crack. • For future reference :) Jan 31 at 14:02 • Cracked! Jan 31 at 14:02 • @DomHastings Oh, thanks. Jan 31 at 14:03 • I hope you took that the way it was intended! It was truly about sharing knowledge, it's not something I'd seen until I'd played with BF a lot so thought it might be useful to you! Jan 31 at 14:07 • @DomHastings Nice, searched for a bit on google if there are any shorter approaches, but didn't find anything, thanks. Jan 31 at 14:16 # MathGolf, 1 byte, score 100000000-10000000=90000000 100,000,000: ↕ 10,000,000: ◄ Try it online. I would be surprised if this is crackable.. # Python 3, 63 bytes, score $$\2\rightarrow12\rightarrow(9^{99}-1)-2\rightarrow11\rightarrow(9^{99}-1)\$$ Program 1: A=lambda m,n:m and A(m-1,n<1or A(m,n-1))or-~n print(A(9**99,8))  Try it online! Program 2: A=lambda m,n:m and A(m-1,n<1or A(m,n-1))or-~n print(A(9**99,9))  Try it online! This just calculates the difference between two nearby invocations of the Ackermann function. • I'm getting a recursion error? infinite recursion for both... Feb 1 at 22:04 • @12944qwerty They give a recursion error because Python (nor any language on any computer) cannot actually practically compute A(9*99,8); it's too large a number Feb 2 at 13:13 # JavaScript (Node.js), 22 bytes, Score=$$\\frac 19\times 10^{10000000}-\frac 19\$$, cracked x=>'8'.repeat(9999999) x=>'9'.repeat(9999999)  Try it online! # brainfuck, 19 bytes, Score=$$\3\times 10^{254}\$$, unlikely crackable +[+++++>+<]+[>.<+] +[+++++>+<]++[>.<+]  Try it online! • p.s. I have no solution for this – l4m2 Jan 31 at 11:41 • Both programs must be the same size. The first one is only 18 bytes? Jan 31 at 11:47 • @Dingus Add space if you like – l4m2 Jan 31 at 11:57 • What's the second JavaScript program? Jan 31 at 12:18 • Jan 31 at 14:42 # Lexurgy, score $$\11111111111111111\$$, 121 bytes Both programs use the following method: 1. Output a string of 26 digits 2. Make 16 copies of those digits and append them to the end. ### Program 1: Outputs 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999988888888888888888 (425 9s then 17 8s). a: *=>\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\8 b: []$1=>$1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1  ### Program 2: Outputs 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 (442 9s). a: *=>\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9\9 b: []$1=>$1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1$1 $1  ## Minimal answer: score $$\9-8=1\$$, 8 bytes # program 1 a: *=>\8 # program 2 a: *=>\9  # !@#$%^&*()_+, 6 bytes, score: 1001001, Cracked by emanresu

(#)


The first three bytes are char code 127.

Try it online!

~~~(#)


Try it online!

You can't see the solution, But this is easy

# MATLAB, 1.797693e+308 - 1.797047e+308 = 6.463132e+304, 7 bytes

realmax


outputs 1.797693e308

5175^83


outputs 1.797047e+308

Try it online!

• I think this is easily cracked by 1e10 -- also you can use Octave for a close approximation to MATLAB. MATL is based on MATLAB but is a very different language! Feb 3 at 15:59
• Updated to fix that, and hopefully made it harder to crack Feb 3 at 16:15
• cracked! Feb 3 at 16:22
• Try again! good luck Feb 3 at 19:08

# Python3, 41 bytes, score=$$\2.82×10^{456573}-2.82×10^{446573}\$$, Cracked

import math
print(math.factorial(100000))


Try it online!

import math
print(math.factorial(99999))


Try it online!

This is embarrassing i forgot that you can just do 3*10**456573

• Cracked? Feb 2 at 13:53
• By the way, the lengths of the programs are different from each other. They should be the same. Feb 3 at 9:34

## PHP4, score ≈ 0.011 × 10^1000

Program 1 (23 chars) output 999 times 9 :

echo str_repeat(9,999);


Program 2 (23 chars) output 999 times 8 :

echo str_repeat(8,999);


Output of both PHP4 scripts is a 999 digits integer in decimal form.

var_dump(chop($out_1, '0..9') === ''); // bool(true) var_dump(chop($out_2, '0..9') === ''); // bool(true)


BC Math is only available if PHP was configured with --enable-bcmath, by default there is not.