I've only recently started getting involved on Code Golf, so excuse my ignorance, but is there a format for longest possible way to achieve a challenge request? Either by runtime or by code length. Some rules I thought of for this format after browsing loopholes:
For longest runtime:
- Code must have at least a theoretical possibility of termination. An example of this would be Bozo Sort: Because it is based on (pseudo-) random probability, no matter how long it takes, it has a theoretical chance of running to completion.
- Clock speed of the computer running the challenge must be taken into account somehow when calculating the score. Perhaps as a multiple of the actual runtime in milliseconds, or maybe OP should be responsible for timing answers on his machine if it's practical to do so.
- Theoretical average-case performance of an answer must be used rather than specific runs with specific data unless otherwise specified, especially if the algorithm uses an RNG. Questions where this may affect the score should specify how to time the execution of an answer.
For longest length code:
- All statements in the program must contribute specifically towards the completion of the challenge. Examples of invalid statements are
var uselessVar;, a repeating chain of statements (e.g.
- To clarify the last point further, at no point in the program can a statement "undo" something that was done in another statement. This should hopefully be a given for this format.
var self = this;is acceptable.
- All function and variable names declared in the program count only as 1 byte / char / stroke.
- All answers should be in natively written language of choice; importing a 3rd party library violates the restriction that "all statements in the program must contribute specifically towards the completion of the challenge". Note that this is different than importing a standard library, and in fact doing so is encouraged if a standard function exists from it which you need to complete a challenge.
var arr; arr = new Array();
arrnor the newline are necessary to separate the statements, but at least one of them is. Because of this, the length of this snippet will be calculated after formatting it like this:
var a;a=new Array()
which is to say, all extraneous characters are removed (
arris shortened to
adue to the 4th bullet point).
There may be more applicable restrictions but I hope this at least conveys the format I'm asking about. Does something like this exist, and if not, would it be a worthwhile addition to the list of question formats?