-4
\$\begingroup\$

I'm surprised this hasn't been done yet, but here we go.

Create a program which prints some number of 1s (ideally as large as possible) before halting.

The rules are simple:

Your program is bounded to 50 bytes in size.

Your output must only be a continuous row of 1s (plus trailing newline if it has to be added), without any breaks in the middle.

Your program must halt. No infinite loops.

Your program must not use STDIN or output to STDERR.

Your program must use STDOUT or closest equivalent.

Your score is the amount of 1s your program prints before halting.

Have fun.

\$\endgroup\$
  • 4
    \$\begingroup\$ Well, there have been many extremely related challenges, with the only significant difference that they didn't arbitrarily demand unary output (codegolf.stackexchange.com/questions/18028/… is the first one I can recall; there have been some like "Golf a number bigger than [insert large number name here]") \$\endgroup\$ – my pronoun is monicareinstate Oct 22 '19 at 15:12
  • \$\begingroup\$ I was looking to emulate busy beaver Turing machines in this challenge. \$\endgroup\$ – Andrew Oct 22 '19 at 15:13
3
\$\begingroup\$

Runic Enchantments, Score: Aproximately (10↑↑200) (10↑↑303)18.877

>>>yybbqf:p'!A'!A'!A'!A'!A'!A'!A'!A'!A'!AFm1)b*?*@

Try it online!

Utilizes Stephen's idea of factorials (they're kind of expensive in Runic, so I hadn't considered them originally) and managed to squeeze out two three hundred of them via implicit edge looping. Value-in is 15^15 (437,893,890,380,859,375) and the resulting value is then multiplied against the string 1111 (bbq is just as long as "1" and produces more 1s).

200->300 accomplished by removing flow control logic and simply raising the "skip when true" to jump over the start of the program (executes the :p for bonus length, but is dwarfed by the factorials, but is responsible for the extra 3 powers of 10 in the tower).

"Wolfram|Alpha doesn't understand your query"

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Python, 9^9^9^9^9^9^9^9^9^9^9^9^9 (or 9↑↑13)

print("1"*(9**9**9**9**9**9**9**9**9**9**9**9**9))

I hope this is right

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ you are right, my bad \$\endgroup\$ – Delta Oct 22 '19 at 15:24
2
\$\begingroup\$

cQuents, Aproximately (10↑↑45)7.347

"#t!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&1

Try it online!

Note that it does not start printing the 1s until it calculates the result of the factorial, so this probably will not run on any real system.

According to Wolfram Alpha, this value equals

enter image description here

or in plaintext

10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^(10^7.346902562777663))))))))))))))))))))))))))))))))))))))))))))
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I originally discounted factorials because computing one in Runic takes 3 bytes, but they're individually powerful, definitely boosted my score. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 16:33
2
\$\begingroup\$

Python 3 approx 9↑↑(36^8) 9↑↑(36↑(9↑↑3))

print("1"*eval("**".join("9"*int('z'*9**9**9,36)))

Must calculate first.

(Edited because I'm bad at math notation, and to include an improvement from randomdude999)

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ 9**9**9 is larger than 9999999. \$\endgroup\$ – randomdude999 Oct 22 '19 at 17:52
  • 1
    \$\begingroup\$ Pretty sure your score is correct, though I am not 100% certain (for reference x↑↑y ~= 10↑↑y; the y makes a bigger impact and that's a BIG y). \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 17:54
  • \$\begingroup\$ @Draco18s The int(..., 36) means "This number in base-36". With the first argument, it's 'zzzz....' as an integer with 0-9 then a-z as the digits. So, I'm pretty sure that it's just one arrow. \$\endgroup\$ – mypetlion Oct 22 '19 at 18:21
  • 1
    \$\begingroup\$ I knew what the command was, I just couldn't deal with what the resulting value was. I think you're correct though. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 18:26
  • \$\begingroup\$ @Draco18s Oh gotcha. Thanks for the help with the notation! Never been my strong suit. \$\endgroup\$ – mypetlion Oct 22 '19 at 18:37
2
\$\begingroup\$

MATLAB, Score: 9↑↑(2↑(10↑313))

x=9;
while(cputime<realmax/2)
x=x^x;
end
ones(1,x)

Try it online!

cputime counts the number of seconds that the MATLAB thread actually runs on the CPU as a double. realmax is the maximum double, ~10^308; I divide by 2 because cputime will rollover back to zero and we actually need the loop to stop. According to the profiler, on my computer MATLAB can run the loop 1e6 times in about 3.7 seconds. That means we'll perform x=x^x about 10^313 times! That isn't just 9↑↑(10↑313), because it compounds on every loop. It's 9↑↑(2↑(10↑313)) I think. I could cheat and make the condition cputime==realmax/2, and then it would be up to random chance when the program finally ends, making an absolutely insane number, but one that can't be calculated.


MATLAB, Score: 9↑↑79 (or about (10↑↑78)8.568)

f=@(x) factorial(x)^x;
ones(1,f(f(f(f(9^9^9^9)))))

Try it online!

Probly not as big as the power tower answers though. I need to figure out a short way to do that here.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ @Draco18s Sorry I overwrote your edit. Can you figure out about how big this version is? Wolfram stalls out \$\endgroup\$ – HiddenBabel Oct 22 '19 at 17:25
  • \$\begingroup\$ @Draco18s Nah, the ^x does something. factorial(9^9^9^9)^factorial(9^9^9^9) is already 10||9 wolframalpha.com/input/… \$\endgroup\$ – HiddenBabel Oct 22 '19 at 18:20
  • \$\begingroup\$ @Draco18s I'll try to work it out later, with Stirling's approximation or something \$\endgroup\$ – HiddenBabel Oct 22 '19 at 18:30
  • \$\begingroup\$ Think I figured it out. On some value x↑↑y your lambda f results in (x↑↑(y+1))^(x↑↑y). For some value (x↑↑y)^(x↑↑z) that is equal to x↑↑(y+z). So your answer should have a score of 9↑↑79 (which is a little less than 10↑↑79; (10↑↑78)^8.568). \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 19:43
  • 1
    \$\begingroup\$ Was definitely one of those "go get lunch and mull over the problem" sort of solutions. I ran through what "10↑↑2 ^ 10↑↑2" meant and then the pattern made sense. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 21:14
1
\$\begingroup\$

PHP, 43 bytes, Score: ~1e17 (based on my PC performance)

set_time_limit(-1);while(time()<4e9)echo 1;

Try it online!

This will run until 2096-10-02 and then stop. This isn't an infinite loop as it will finally halt. I can set it to longer dates, but I think 4e9 or 2096-10-02 is good enough for me, it is about the idea 😊

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ This is dumb, but it works. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 15:39
  • 4
    \$\begingroup\$ Even if this printed one 1 every nanosecond this would score much less than most of the other answers so far. \$\endgroup\$ – FryAmTheEggman Oct 22 '19 at 15:42
  • \$\begingroup\$ @FryAmTheEggman, true. \$\endgroup\$ – Night2 Oct 22 '19 at 15:52
0
\$\begingroup\$

05AB1E, approx. (10↑↑46)10.994 amount of 1s (50 bytes)

žm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1×

Explanation:

žm             # Push the builtin 9876543210
  !!!...!!!    # Take the factorial 46 times
           1×  # Push that many 1s as string
               # (after which it's output implicitly as result)

This will print exactly \$9876543210↑↑46\$ amount of 1s, or approx. \$(10↑↑46)^{10.994}\$ (thanks to @Draco18s for explaining how to calculate this \$(10↑↑a)^b\$ approximation.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ how large 9876543210↑↑56 is. Only about (10↑↑56)^11. Two arrows (10↑↑2) is just powers (10^10) (or 10↑↑3 -> 10^10^10), so the number on the right matters more than the number on the left. It works out that each factorial adds a 10 to the tower. Also, I think your tower is 46, not 56. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 17:01
  • \$\begingroup\$ @Draco18s Oops, 46 instead of 56 indeed, edited. I know \$10↑↑3\$ is \$10^{{10}^{10}}\$, I just wasn't sure how large \$9876543210↑↑46\$ is when using \$10↑↑x\$ as well. I'm still not sure how you calculated that \$11\$ in \$9876543210↑↑56 ≈ (10↑↑56)^{11}\$ to be honest, or is the \$11\$ the size of the integer on the right + 1? \$\endgroup\$ – Kevin Cruijssen Oct 22 '19 at 17:12
  • 1
    \$\begingroup\$ I understood why you had the question, it just works out that x↑↑y is approximately equal to (10↑↑y) (or closer to (10↑↑y)^(log10(2x))). eg 100↑↑4 and 10↑↑4. Note that the first one is (10↑↑4)^2.3, but W|A displays powers of ten up to 5 digits, but we can extract the right value. The log10 bit just tacks on to the end of the stack (100↑↑4 -> 10^10^10^10^2.3), parents only distinguish it from 10↑↑(10^2.3) (wrong!) \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 17:25
  • \$\begingroup\$ @Draco18s Hmm ok. But why the \$11\$ then? Since \$\log_{10}(2×9876543210)\$ seems to be approx. \$10.296\$ instead of \$11\$. So the \$9876543210↑↑46\$ in my answer would be roughly \$(10↑↑46)^{10.296}\$ in that case? \$\endgroup\$ – Kevin Cruijssen Oct 22 '19 at 17:39
  • 1
    \$\begingroup\$ Works out to what happened when I plugged it (9876543210) in to W|A 5 times. I got 10.994. The log10(2x) is only an approximation, and its a bit low. (100 results in a power of 200.3 on top of the tens, for example, not exactly 200). But if I plug in 15 copies instead of 5, that last value doesn't change (or if it does, its very small), so its easy to extrapolate what happens at 50 copies. \$\endgroup\$ – Draco18s no longer trusts SE Oct 22 '19 at 17:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.