[Question]
  [
**Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers.
 
 
Closed 7 years ago.
**Locked**. This question and its answers are [locked](/help/locked-posts) because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
 
 
A question similar to this has been [asked a couple of years ago](https://codegolf.stackexchange.com/questions/1034/reinvent-the-for-loop), but this one is even trickier. 
The challenge is simple. Write a program (in your language of choice) that repeatedly executes code without using any repetition structures such as `while`, `for`, `do while`, `foreach` or `goto` (**So for all you nitpickers, you can't use a loop**). However, ***recursion is not allowed, in the function calling itself sense (see definition below)***. That would make this challenge far too easy.
There is no restriction on what needs to be executed in the loop, **but post an explanation with your answer** so that others can understand exactly what is being implemented.
For those who may be hung up on definitions, the definition of a loop for this question is:
`A programming language statement which allows code to be repeatedly executed.`
And the definition of recursion for this question will be your standard recursive function definition:
`A function that calls itself.`
Winner will be the answer that has the most upvotes on July 16th at 10 AM eastern time. Good luck!
**UPDATE:**
To calm confusion that is still being expressed this may help:
Rules as stated above:
* Don't use loops or goto
* Functions cannot call themselves
* Do whatever you want in the 'loop'
If you want to implement something and the rules don't explicitly disallow it, go ahead and do it. Many answers have already bent the rules.
  
[Answer]
# Ruby
```
def method_missing(meth,*args)
  puts 'Banana'
  send(meth.next)
end
def also
  puts "Orange you glad I didn't say banana?"
end
ahem
```
[Demo](https://ideone.com/4xwWoX)
Clears its throat, prints "Banana" 3070 times, and also puts "Orange you glad I didn't say banana?".
This uses Ruby's ridiculous just-in-time method definition functionality to define every method that lies alphabetically between the words 'ahem' and 'also' ("ahem", "ahen", "aheo", "ahep", "aheq", "aher", "ahes", "ahet", "aheu", "ahev"...) to first print Banana and then call the next in the list.
[Answer]
# Python - 16
or any other language with eval.
```
exec"print 1;"*9
```
[Answer]
# CSharp
I've expanded the code into a more readable fashion as this is no longer code golf and added an increment counter so that people can actually see that this program does something.
```
class P{
    static int x=0;
    ~P(){
        System.Console.WriteLine(++x);
        new P();
    }
    static void Main(){
        new P();
    }
}
```
(Don't do this ever please).
On start we create a new instance of the `P` class, which when the program tries to exit calls the GC which calls the finalizer which creates a new instance of the `P` class, which when it tries to clean up creates a new `P` which calls the finalizer...
The program eventually dies.
Edit:
Inexplicably this runs only around 45k times before dying. I don't quite know how the GC figured out my tricky infinite loop but it did.
The short is it seems it didn't figure it out and the thread just was killed after around 2 seconds of execution:
<https://stackoverflow.com/questions/24662454/how-does-a-garbage-collector-avoid-an-infinite-loop-here>
Edit2:
If you think this is a little too much like recursion consider my other solution:
<https://codegolf.stackexchange.com/a/33268/23300>
It uses reification of generic methods so that at runtime it constantly is generating new methods and each method in term calls a newly minted method. I also avoid using `reference` type parameters, as normally the runtime can share the code for those methods. With a `value` type parameter the runtime is forced to create a new method.
[Answer]
# Befunge
```
.
```
Good old Befunge outputs 0 (from an empty stack) pretty much forever, as lines wrap around.
[Answer]
**JS**
`(f=function(){ console.log('hi!'); eval("("+f+")()") })()`
Function fun!
A function that creates another function with the same body as itself and then runs it.
It will display hi at the end when the stack limit is reached and the entire thing collapses.
Disclaimer: you'll not be able to do anything in your browser until stack limit is reached.
---
And another one, more **evil**:
`function f(){ var tab = window.open(); tab.f = f; tab.f()}()`
It creates a function which opens up a window, then creates a function within that window which is copy of the function, and then runs it.
Disclaimer: if you'll allow opening of popups the only way to finish this will be to restart your computer
[Answer]
# x86 assembly/DOS
```
    org 100h
start:
    mov dx,data
    mov ah,9h
    int 21h
    push start
    ret
data:
    db "Hello World!",10,13,"$"
```
> 
> Did I say no *reversed tail* recursion? Did I? 
>  ![madame mim purple dragons](https://i.stack.imgur.com/Yusgo.jpg)
> 
> 
> 
### How it works
> 
>  The `ret` instruction, used to return from a function, actually pops the return address from the stack (which normally is put there by the corresponding `call`) and jumps to it. Here at each iteration we `push` the entrypoint address on the stack before returning, thus generating an infinite loop.
> 
> 
> 
[Answer]
# Java
Straight from XKCD
[![Bonding](https://i.stack.imgur.com/8UITm.png "I'm trying to build character but Eclipse is really confusing.")](https://xkcd.com/1188/)
It's a never-ending game of catch between a parent and child!
The target of `CHILD` is set to `PARENT` and the target of `PARENT` is the `CHILD`. When the `PARENT` calls `AIM`, it throws the instance of the `BALL` class and it is caught by the catch statement. The catch statement then calls `PARENT.TARGET.AIM` where the target is the `CHILD`. The `CHILD` instance does the same and "throws the ball back" to the parent.
[Answer]
# Bash, 3 characters
```
yes
```
yes will repeatedly return 'y' to the console
Edit: Everyone is encouraged to edit this line:
```
yes something | xargs someaction
```
(thanks to Olivier Dulac)
[Answer]
# C, 35 characters
```
main(int a,char**v){execv(v[0],v);}
```
The program executes itself. I'm not sure if this is considered recursion or not.
[Answer]
# C (with GCC builtins - also seems to work with clang)
* No explicit loops
* No explicit gotos
* No recursion
* Just good old-fashioned messing with the stack (kids, don't try this at home without supervision):
```
#include <stdio.h>
void *frameloop (void *ret_addr) {
    void **fp;
    void *my_ra = __builtin_return_address(0);
    if (ret_addr) {
        fp = __builtin_frame_address(0);
        if (*fp == my_ra) return (*fp = ret_addr);
        else fp++;
        if (*fp == my_ra) return (*fp = ret_addr);
        else fp++;
        if (*fp == my_ra) return (*fp = ret_addr);
        else fp++;
        if (*fp == my_ra) return (*fp = ret_addr);
        return NULL;
    } else {
        return (my_ra);
    }
}
int main (int argc, char **argv) {
    void *ret_addr;
    int i = 0;
    ret_addr = frameloop(NULL);
    printf("Hello World %d\n", i++);
    if (i < 10) {
        frameloop(ret_addr);
    }
}
```
### Explanation:
* `main()` first calls `frameloop(NULL)`. In this case use the `__builtin_return_address()` builtin to get the return address (in `main()`) that `frameloop()` will return to. We return this address.
* `printf()` to show we're looping
* now we call `frameloop()` with the return address for the previous call. We look through the stack for the current return address, and when we find it, we substitute the previous return address.
* We then return from the 2nd `frameloop()` call. But since the return address was hacked above, we end up returning to the point in `main()` where the first call should return to. Thus we end up in a loop.
The search for the return address in the stack would of course be cleaner as a loop, but I unrolled a few iterations for the sake of no looping whatsoever.
### Output:
```
$ CFLAGS=-g make frameloop
cc -g    frameloop.c   -o frameloop
$ ./frameloop 
Hello World 0
Hello World 1
Hello World 2
Hello World 3
Hello World 4
Hello World 5
Hello World 6
Hello World 7
Hello World 8
Hello World 9
$ 
```
[Answer]
# Haskell
The following code contains **no recursive function (even indirectly), no looping primitive and doesn't call any built-in recursive function** (uses only `IO`'s output and binding), yet it repeats a given action idenfinitely:
```
data Strange a = C (Strange a -> a)
-- Extract a value out of 'Strange'
extract :: Strange a -> a
extract (x@(C x')) = x' x
-- The Y combinator, which allows to express arbitrary recursion
yc :: (a -> a) -> a
yc f =  let fxx = C (\x -> f (extract x))
        in extract fxx
main = yc (putStrLn "Hello world" >>)
```
Function `extract` doesn't call anything, `yc` calls just `extract` and `main` calls just `yc` and `putStrLn` and `>>`, which aren't recursive.
**Explanation:** The trick is in the recursive data type `Strange`. It is a recursive data type that consumes itself, which, as shown in the example, allows arbitrary repetition. First, we can construct `extract x`, which essentially expresses self-application `x x` in the untyped lambda calculus. And this allows to construct [the Y combinator](https://en.wikipedia.org/wiki/Fixed-point_combinator#Fixed_point_combinators_in_lambda_calculus) defined as `λf.(λx.f(xx))(λx.f(xx))`.
---
**Update:** As suggested, I'm posting a variant that is closer to the definition of **Y** in the untyped lambda calculus:
```
data Strange a = C (Strange a -> a)
-- | Apply one term to another, removing the constructor.
(#) :: Strange a -> Strange a -> a
(C f) # x = f x
infixl 3 #
-- The Y combinator, which allows to express arbitrary recursion
yc :: (a -> a) -> a
yc f =  C (\x -> f (x # x)) # C (\x -> f (x # x))
main = yc (putStrLn "Hello world" >>)
```
[Answer]
## C++
The following outputs a countdown from 10 to "Blast off!" using template metaprogramming.
```
#include <iostream>
template<int N>
void countdown() {
    std::cout << "T minus " << N << std::endl;
    countdown<N-1>();
}
template<>
void countdown<0>() {
    std::cout << "Blast off!" << std::endl;
}
int main()
{
    countdown<10>();
    return 0;
}
```
It might look like a classic example of recursion, but it actually isn't, at least technically, depending on your definition. The compiler will generate ten *different* functions. `countdown<10>` prints "T minus 10" and then calls `countdown<9>`, and so on down to `countdown<0>`, which prints "Blast off!" and then returns. The recursion happens when you compile the code, but the executable doesn't contain any looping structures.
In C++11 one can achieve similar effects using the `constexpr` keyword, such as this factorial function. (It's not possible to implement the countdown example this way, since `constexpr` functions can't have side-effects, but I think it might be possible in the upcoming C++14.)
```
constexpr int factorial(int n)
{
    return n <= 1 ? 1 : (n * factorial(n-1));
}
```
Again this really looks like recursion, but the compiler will expand out `factorial(10)` into `10*9*8*7*6*5*4*3*2*1`, and then probably replace it with a constant value of `3628800`, so the executable will not contain any looping or recursive code.
[Answer]
## Java
Let's play with Java class loader and set it as its own parent:
```
import java.lang.reflect.Field;
public class Loop {
    public static void main(String[] args) throws Exception {
        System.out.println("Let's loop");
        Field field = ClassLoader.class.getDeclaredField("parent");
        field.setAccessible(true);
        field.set(Loop.class.getClassLoader(), Loop.class.getClassLoader());
    }
}
```
This loop is actually so strong you'll have to use a `kill -9` to stop it :-) 
It uses 100,1% of my Mac's CPU.
![100,1% of CPU](https://i.stack.imgur.com/9EzWR.png)
You can try to move the `System.out` at the end of the main function to experiment an alternate funny behavior.
[Answer]
# CSharp
One more and equally wicked::
```
public class P{
    
    class A<B>{
        public static int C<T>(){
            System.Console.WriteLine(typeof(T));
            return C<A<T>>();
        }
    }
    public static void Main(){
        A<P>.C<int>();
    }
}
```
This is not recursion... this is reification of code templates. While it appears we are calling the same method, the runtime is constantly creating new methods. We use the type parameter of int, as this actually forces it to create an entire new type and each instance of the method has to jit a new method. It cannot code share here. Eventually, we kill the call stack as it waits infinitely for the return of int that we promised but never delivered. In a similar fashion, we keep writing the type we created to keep it interesting. Basically each C we call is an enitrely new method that just has the same body. This is not really possible in a language like C++ or D that do their templates at compile time. Since, C# JIT is super lazy it only creates this stuff at the last possible moment. Thus, this is another fun way to get csharp to keep calling the same code over and over and over...
[Answer]
## Redcode 94 (Core War)
`MOV 0, 1`
Copies instruction at address zero to address one. Because in Core War all addresses are relative to current PC address and modulo the size of the core, this is an infinite loop in one, non-jump, instruction.
This program (warrior) is called "[Imp](http://vyznev.net/corewar/guide.html#start_imp)" and was first published by AK Dewdney.
[Answer]
## Dart
I guess this would be the classical way of doing recursion without any actual recursive function. No function below refers to itself by name, directly or indirectly.
(Try it at [dartpad.dartlang.org](https://dartpad.dartlang.org/4725ead1e9baefb44b7d))
```
// Strict fixpoint operator.
fix(f) => ((x)=>f(x(x))) ((x)=>(v)=>f(x(x))(v));
// Repeat action while it returns true.
void repeat(action) { fix((rep1) => (b) { if (b()) rep1(b); })(action); }
main() {
  int x = 0;
  repeat(() {  
    print(++x);
    return x < 10;
  });
}
```
[Answer]
## JS
Not very original but small. 20 chars.
```
setInterval(alert,1)
```
[Answer]
# Signals in C
```
#include <stdio.h>
#include <signal.h>
int main(void) {
    signal(SIGSEGV, main);
    *(int*)printf("Hello, world!\n") = 0;
    return 0;
}
```
The behaviour of this program is obviously very much undefined, but today, on my computer, it keeps printing "Hello, world!".
[Answer]
# Emacs Lisp
This is a great time to show off Lisp's powerful design where "code is data and data is code". Granted, these examples are very inefficient and this should never be used in a real context. 
The macros generate code that is an unrolled version of the supposed loop and that generated code is what is evaluated at runtime.
## repeat-it: allows you to loop N times
```
(defmacro repeat-it (n &rest body)
  "Evaluate BODY N number of times.
Returns the result of the last evaluation of the last expression in BODY."
  (declare (indent defun))
  (cons 'progn (make-list n (cons 'progn body))))
```
## repeat-it test:
```
;; repeat-it test
(progn
  (setq foobar 1)
  (repeat-it 10
    (setq foobar (1+ foobar)))
  ;; assert that we incremented foobar n times
  (assert (= foobar 11)))
```
## repeat-it-with-index:
This macro is like `repeat-it` but it actually works just like the common looping macro `do-times` it allows you to specify a symbol that will be bound to the loop index. It uses an expansion time symbol to ensure that the index variable is set correctly at the beginning of each loop regardless of whether or not you modify it's value during the loop body.
```
(defmacro repeat-it-with-index (var-and-n &rest body)
  "Evaluate BODY N number of times with VAR bound to successive integers from 0 inclusive to n exclusive..
VAR-AND-N should be in the form (VAR N).
Returns the result of the last evaluation of the last expression in BODY."
  (declare (indent defun))
  (let ((fallback-sym (make-symbol "fallback")))
    `(let ((,(first var-and-n) 0)
           (,fallback-sym 0))
       ,(cons 'progn
              (make-list (second var-and-n)
                         `(progn
                            (setq ,(first var-and-n) ,fallback-sym)
                            ,@body
                            (incf ,fallback-sym)))))))
```
## repeat-it-with-index test:
This test shows that:
1. The body does evaluate N times
2. the index variable is always set correctly at the beginning of each iteration
3. changing the value of a symbol named "fallback" won't mess with the index
```
;; repeat-it-with-index test
(progn
  ;; first expected index is 0
  (setq expected-index 0)
  ;; start repeating
  (repeat-it-with-index (index 50)
    ;; change the value of a  'fallback' symbol
    (setq fallback (random 10000))
    ;; assert that index is set correctly, and that the changes to
    ;; fallback has no affect on its value
    (assert (= index expected-index))
    ;; change the value of index
    (setq index (+ 100 (random 1000)))
    ;; assert that it has changed
    (assert (not (= index expected-index)))
    ;; increment the expected value
    (incf expected-index))
  ;; assert that the final expected value is n
  (assert (= expected-index 50)))
```
[Answer]
# Untyped lambda calculus
```
λf.(λx.f (x x)) (λx.f (x x))
```
[Answer]
**Haskell, 24 characters**
```
sequence_ (repeat (print "abc"))
```
or in a condensed form, with 24 characters
```
sequence_$repeat$print"" 
```
(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)
explanation:
print "abc" is basically an i/o action that just prints "abc".  
repeat is a function which takes a value x and returns an infinite list made of only x.  
sequence\_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.
so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.
[Answer]
## ASM (x86 + I/O for Linux)
It does not matter how much your puny high level languages will struggle, it will still be just hidden instruction pointer manipulation. In the end it will be some sort of "goto" (jmp), unless you are bored enough to unroll loop in runtime.
You can test code on [Ideone](http://ideone.com/qioUUp)
You can also check out more refined version of this idea in [Matteo Italia DOS code](https://codegolf.stackexchange.com/a/34298/21193).
It starts with string of 0..9 and replaces it with A..J, no direct jumps used (so lets say that no "goto" happened), no recurrence either. 
Code probably could be smaller with some abuse of address calculation, but working on online compiler is bothersome so I will leave it as it is.
Core part:
```
mov dl, 'A' ; I refuse to explain this line!
mov ebx, msg ; output array (string)
call rawr   ; lets put address of "rawr" line on stack
rawr: pop eax ; and to variable with it! In same time we are breaking "ret"
add eax, 4 ; pop eax takes 4 bytes of memory, so for sake of stack lets skip it
mov [ebx], dl ; write letter
inc dl ; and proceed to next 
inc ebx
cmp dl, 'J' ; if we are done, simulate return/break by leaving this dangerous area
jg print
push eax ; and now lets abuse "ret" by making "call" by hand
ret
```
Whole code
```
section     .text
global      _start                              
_start:
;<core>
mov dl, 'A'
mov ebx, msg
call rawr
rawr: pop eax
add eax, 4
mov [ebx], dl
inc dl
inc ebx
cmp dl, 'J'
jg print
push eax
ret
;</core>
; just some Console.Write()
print:
    mov     edx,len
    mov     ecx,msg
    mov     ebx,1
    mov     eax,4
    int     0x80
    mov     eax,1
    xor     ebx, ebx
    int     0x80
section     .data
msg     db  '0123456789',0xa
len     equ $ - msg
```
[Answer]
# C Preprocessor
A little "technique" that I came up with during an obfuscation challenge. There's no function recursion, but there is... file recursion?
noloop.c:
```
#if __INCLUDE_LEVEL__ == 0
int main() 
{
    puts("There is no loop...");
#endif
#if __INCLUDE_LEVEL__ <= 16
    puts(".. but Im in ur loop!");
    #include "noloop.c"
#else
    return 0;
}
#endif
```
I wrote/tested this using gcc. Obviously your compiler needs to support the `__INCLUDE_LEVEL__` macro (or alternatively the `__COUNTER__` macro with some tweaking) in order for this to compile. It should be fairly obvious how this works, but for fun, run the preprocessor without compiling the code (use the `-E` flag with gcc).
[Answer]
# PHP
Here's one with PHP. Loops by including the same file until counter reaches $max:
```
<?php
if (!isset($i))
    $i = 0;        // Initialize $i with 0
$max = 10;         // Target value
// Loop body here
echo "Iteration $i <br>\n";
$i++;               // Increase $i by one on every iteration
if ($i == $max)
    die('done');    // When $i reaches $max, end the script
include(__FILE__);  // Proceed with the loop
?>
```
The same as a for-loop:
```
<?php
for ($i = 0; $i < 10; $i++) {
    echo "Iteration $i <br>\n";
}
die('done');
?>
```
[Answer]
# Python
The following code contains **no recursive function (directly or indirect), no looping primitive and doesn't call any built-in function** (except `print`):
```
def z(f):
    g = lambda x: lambda w: f(lambda v: (x(x))(v), w)
    return g(g)
if __name__ == "__main__":
    def msg(rec, n):
        if (n > 0):
            print "Hello world!"
            rec(n - 1)
    z(msg)(7)
```
Prints "Hello world!" a given number of times.
**Explanation:** Function `z` implements the [strict **Z** fixed-point combinator](https://en.wikipedia.org/wiki/Fixed-point_combinator#Strict_fixed_point_combinator), which (while not recursively defined) allows to express any recursive algorithm.
[Answer]
# z80 machine code
In an environment where you can execute at every address and map ROM everywhere, map 64kb of ROM filled with zeroes to the entire address space.
What it does: nothing. Repeatedly.
How it works: the processor will start executing, the byte `00` is a `nop` instruction, so it will just continue on, reach the address `$ffff`, wrap around to `$0000`, and continue executing `nop`s until you reset it.
To make it do slightly more interesting, fill the memory with some other value (be careful to avoid control flow instructions).
[Answer]
# Perl-regex
```
(q x x x 10) =~ /(?{ print "hello\n" })(?!)/;
```
[demo](http://ideone.com/dgZElL)
or try it as:
```
perl -e '(q x x x 10) =~ /(?{ print "hello\n" })(?!)/;'
```
The `(?!)` never match. So the regex engine tries to match each *zero width positions* in the matched string.
The `(q x x x 10)` is the same as `(" " x 10)` - repeat the `space` ten times.
Edit: changed the "characters" to *zero width positions* to be more precise for better understandability. See answers to [this stackoverflow question](https://stackoverflow.com/questions/24716669/codegolf-regex-match).
[Answer]
# T-SQL -12
```
print 1
GO 9
```
> 
>  Actually more of a quirk of Sql Server Management Studio. GO is a script separator and is not part of the T-SQL language. If you specify GO followed by a number it will execute the block that many times.
> 
> 
> 
[Answer]
## C#
Prints out all integers from uint.MaxValue to 0.
```
   class Program
   {
      public static void Main()
      {
          uint max = uint.MaxValue;
          SuperWriteLine(ref max);
          Console.WriteLine(0);
      }
      static void SuperWriteLine(ref uint num)
      {
          if ((num & (1 << 31)) > 0) { WriteLine32(ref num); }
          if ((num & (1 << 30)) > 0) { WriteLine31(ref num); }
          if ((num & (1 << 29)) > 0) { WriteLine30(ref num); }
          if ((num & (1 << 28)) > 0) { WriteLine29(ref num); }
          if ((num & (1 << 27)) > 0) { WriteLine28(ref num); }
          if ((num & (1 << 26)) > 0) { WriteLine27(ref num); }
          if ((num & (1 << 25)) > 0) { WriteLine26(ref num); }
          if ((num & (1 << 24)) > 0) { WriteLine25(ref num); }
          if ((num & (1 << 23)) > 0) { WriteLine24(ref num); }
          if ((num & (1 << 22)) > 0) { WriteLine23(ref num); }
          if ((num & (1 << 21)) > 0) { WriteLine22(ref num); }
          if ((num & (1 << 20)) > 0) { WriteLine21(ref num); }
          if ((num & (1 << 19)) > 0) { WriteLine20(ref num); }
          if ((num & (1 << 18)) > 0) { WriteLine19(ref num); }
          if ((num & (1 << 17)) > 0) { WriteLine18(ref num); }
          if ((num & (1 << 16)) > 0) { WriteLine17(ref num); }
          if ((num & (1 << 15)) > 0) { WriteLine16(ref num); }
          if ((num & (1 << 14)) > 0) { WriteLine15(ref num); }
          if ((num & (1 << 13)) > 0) { WriteLine14(ref num); }
          if ((num & (1 << 12)) > 0) { WriteLine13(ref num); }
          if ((num & (1 << 11)) > 0) { WriteLine12(ref num); }
          if ((num & (1 << 10)) > 0) { WriteLine11(ref num); }
          if ((num & (1 << 9)) > 0) { WriteLine10(ref num); }
          if ((num & (1 << 8)) > 0) { WriteLine09(ref num); }
          if ((num & (1 << 7)) > 0) { WriteLine08(ref num); }
          if ((num & (1 << 6)) > 0) { WriteLine07(ref num); }
          if ((num & (1 << 5)) > 0) { WriteLine06(ref num); }
          if ((num & (1 << 4)) > 0) { WriteLine05(ref num); }
          if ((num & (1 << 3)) > 0) { WriteLine04(ref num); }
          if ((num & (1 << 2)) > 0) { WriteLine03(ref num); }
          if ((num & (1 <<  1)) > 0) { WriteLine02(ref num); }
          if ((num & (1 <<  0)) > 0) { WriteLine01(ref num); }
      }
      private static void WriteLine32(ref uint num) { WriteLine31(ref num); WriteLine31(ref num); }
      private static void WriteLine31(ref uint num) { WriteLine30(ref num); WriteLine30(ref num); }
      private static void WriteLine30(ref uint num) { WriteLine29(ref num); WriteLine29(ref num); }
      private static void WriteLine29(ref uint num) { WriteLine28(ref num); WriteLine28(ref num); }
      private static void WriteLine28(ref uint num) { WriteLine27(ref num); WriteLine27(ref num); }
      private static void WriteLine27(ref uint num) { WriteLine26(ref num); WriteLine26(ref num); }
      private static void WriteLine26(ref uint num) { WriteLine25(ref num); WriteLine25(ref num); }
      private static void WriteLine25(ref uint num) { WriteLine24(ref num); WriteLine24(ref num); }
      private static void WriteLine24(ref uint num) { WriteLine23(ref num); WriteLine23(ref num); }
      private static void WriteLine23(ref uint num) { WriteLine22(ref num); WriteLine22(ref num); }
      private static void WriteLine22(ref uint num) { WriteLine21(ref num); WriteLine21(ref num); }
      private static void WriteLine21(ref uint num) { WriteLine20(ref num); WriteLine20(ref num); }
      private static void WriteLine20(ref uint num) { WriteLine19(ref num); WriteLine19(ref num); }
      private static void WriteLine19(ref uint num) { WriteLine18(ref num); WriteLine18(ref num); }
      private static void WriteLine18(ref uint num) { WriteLine17(ref num); WriteLine17(ref num); }
      private static void WriteLine17(ref uint num) { WriteLine16(ref num); WriteLine16(ref num); }
      private static void WriteLine16(ref uint num) { WriteLine15(ref num); WriteLine15(ref num); }
      private static void WriteLine15(ref uint num) { WriteLine14(ref num); WriteLine14(ref num); }
      private static void WriteLine14(ref uint num) { WriteLine13(ref num); WriteLine13(ref num); }
      private static void WriteLine13(ref uint num) { WriteLine12(ref num); WriteLine12(ref num); }
      private static void WriteLine12(ref uint num) { WriteLine11(ref num); WriteLine11(ref num); }
      private static void WriteLine11(ref uint num) { WriteLine10(ref num); WriteLine10(ref num); }
      private static void WriteLine10(ref uint num) { WriteLine09(ref num); WriteLine09(ref num); }
      private static void WriteLine09(ref uint num) { WriteLine08(ref num); WriteLine08(ref num); }
      private static void WriteLine08(ref uint num) { WriteLine07(ref num); WriteLine07(ref num); }
      private static void WriteLine07(ref uint num) { WriteLine06(ref num); WriteLine06(ref num); }
      private static void WriteLine06(ref uint num) { WriteLine05(ref num); WriteLine05(ref num); }
      private static void WriteLine05(ref uint num) { WriteLine04(ref num); WriteLine04(ref num); }
      private static void WriteLine04(ref uint num) { WriteLine03(ref num); WriteLine03(ref num); }
      private static void WriteLine03(ref uint num) { WriteLine02(ref num); WriteLine02(ref num); }
      private static void WriteLine02(ref uint num) { WriteLine01(ref num); WriteLine01(ref num); }
      private static void WriteLine01(ref uint num) { Console.WriteLine(num--); }
   }
```
[Answer]
# JS (in browser)
How about this?
```
document.write(new Date());
location = location;
```
Prints the current time and reloads the page.
]