The Almost-Eternity Code

1

1

Write a program that outputs as many characters as possible, with two conditions:

  • The program must be 256 bytes or shorter
  • The program must almost surely eventually halt. In other words, the only thing not permitted in response to this question is an infinite loop.

For the purposes of this problem, any built-in psudo-random number generators will be treated as though they actually produce true random numbers. Even if it takes a really long time (years, centuries, or millennia) to compile, the program MUST BE a valid program in your language (and it must compile in a finite amount of time).

The program which produces the longest textual output before halting wins!!! (This means you must provide an approximate number of the expected length of output).

A note on arbitrary-precision arithmatic: No use of built-in arbitrary precision arithmetic capabilities.

J. Antonio Perez

Posted 2016-11-20T20:34:51.123

Reputation: 1 480

Question was closed 2016-11-20T22:28:29.670

Why the restriction on less than 256 characters? – Rɪᴋᴇʀ – 2016-11-20T20:40:41.627

Because the easiest way to make the program produce a longer output is to just wrap the entire program in a giant tower of for loops: – J. Antonio Perez – 2016-11-20T20:41:28.667

In general, needing extra restrictions is a sign of a bad challenge. You probably shouldn't need that restriction. – Rɪᴋᴇʀ – 2016-11-20T20:42:26.537

1If I don't limit the length of the code, someone's going to just give a giant tower of for-loops inside for-loops as they're response. – J. Antonio Perez – 2016-11-20T20:42:41.287

Yeah, but if that's a valid answer without the restriction then the premise of the challenge may be bad. – Rɪᴋᴇʀ – 2016-11-20T20:43:35.570

A giant tower of for-loops is an acceptable answer, as long as it's less than 256 bytes. – J. Antonio Perez – 2016-11-20T20:43:49.243

1It's like a busy-beaver number with a turing machine. You can make arbitrarily complex turing machines to run for arbitrarily long amounts of time, but busy-beaver numbers are only interesting if you put a limit on the number of symbols and the number of states. – J. Antonio Perez – 2016-11-20T20:45:46.437

Let us continue this discussion in chat.

– J. Antonio Perez – 2016-11-20T20:48:49.517

5

I don't see how this is off-topic. It definitely has an objective primary winning criterion (namely, most characters output). This isn't to say that this wouldn't be a duplicate of Largest Number Printable.

– LegionMammal978 – 2016-11-20T23:07:43.043

2It's not a duplicate. The victory condition also appears to be objective (although some of the resulting numbers may be so high that they're hard to compare). I'd recommend you make some sort of statement about whether the program has to run on a physical computer (which would be subject to things like word size restrictions and the like) or not; it makes a huge amount of difference here! (256 bytes is probably enough to write a program that uses the entirety of the computer's memory as a counter, and it's mathematically impossible to produce more output than that without an infinite loop.) – None – 2016-11-21T00:04:05.757

I have a program that output approximately (on an infinite powered machine) 3.43E214 characters (tell me if you want the exact number, I got it). Written in C99, 256 bytes. – Ludonope – 2016-11-22T19:57:45.350

Correction, I can output 5.28E270 characters in C99, 256 bytes :) – Ludonope – 2016-11-22T20:05:15.067

2The problem with this challenge is that if you allow randomness, it becomes difficult to compare two entries where the expected number of printed characters is infinite. – Zgarb – 2016-11-29T10:29:53.887

"The program which produces the longest textual output before halting wins!!! (This means you must provide an approximate number of the expected length of output)." How is that not an objective winning criterion? – PyRulez – 2018-12-04T01:29:00.070

No answers