Loop without output

From Esolang
Jump to navigation Jump to search

Loop without output is an extremely esoteric computer experiment conducted by User:Star651 in June of 2011. The experiment is esoteric, but it was conducted using a very mainstream programming language; JavaScript. Loop without output is as esoteric as the BF programming language, and, in a very strange way, was inspired by BF. The experiment's basic idea is self-explanitory; it is a loop (a for loop, to be specific) with no output, except outside the loop, when the counter variable is printed on the screen. The only practical use of this "virtual tape loop" is to be amazed at speed; loop without output has been known, on some machines, to do 2,000,000 iterations within 30 seconds, and it takes an hour or two for 1,000,000,000 iterations.

More specifications and example code

The initial JavaScript-based experiment takes a number, counts to that number (using a for loop), but produces absolutely no output for the iteration; the JavaScript loop curly braces are empty, except for maybe a space or newline. The code is placed in HTML script tags, so this esoteric looping device should run in script-enabled web browsers. The JavaScript sample code below (inside HTML script tags) has a variable named j representing the number it takes in; variable i is the counter variable. Variable j in the sample code is set to 500000 (five hundred thousand), but you can change it to whatever number you want, to see how the computer uses it. Be glad it's in JavaScript. You don't need to buy, or even download, any interpreters or compilers; there should be an interpreter right in the ol' Chrome, Firefox or Explorer.


<html>
<head>
<title> Esoteric Loop Without Output Experiment </title>
</head>
<body>
<script>
for(i=1, j=500000; i<j; i++){
} </script>
<script>
document.write(i) </script>
</body>
</html>

The document.write(i) can be replaced with alert(i) if you don't want your results displayed on a 98% blank page.