From Esolang
Jump to navigation Jump to search

D.U.C.K. (an acronym that will have meaning in the future) is an esoteric programming language created by User:SoundOfScripting that is designed to be used by time travellers. It apparently was/will be created sometime during the century beginning with the last year of the 3rd millennium CE.


Coming soon!
Most can be inferred from the examples.

Example programs

Time Traveling Cat

0: D.U.C.K.wait(1);					//Wait 1 second
1: x = input();						//Get input
2: D.U.C.K.send(0);					//Go back to the start of the program
3: output(x);						//Output the input

The above program outputs a value from input one second before the value is inputted (which is at the start of the program).

If the time traveller, after reading the output, attempts to input a different number, D.U.C.K. will go back in time again to receive another input. This will continue until the time traveller (keeping his/her memories of past inputs) gets bored and manually terminates the program (the escape key exits it).

Recent attempts at programming a bot to always input something that is not the output (as long as the bot is too fast for anybody to stop it) have resulted in D.U.C.K. temporarily opening a black whole, swallowing the device running the program, the device running the bot, and the time traveller. This does not appear to be avoidable.

Unexecutable Program

0: D.U.C.K.send(-1);

The above program terminates one second before it is run. Similar problems resulting in black holes have occurred when attempting to execute the program infinitely after it terminates.

Create the Universe

0: x = input();						//
1: y += 99999999999999999999999999999;			//Builds up an infinitely large number
2: if(x == "") D.U.C.K.goto(0);				//
3: D.U.C.K.send(-y);					//Travels back in time that many seconds
4: output("Hello, World!");				//Greet the newly created universe

This program attempts to send the user infinitely far back in time by generating an infinite number (y). However, it is impossible for a human to accomplish this without a bot; even the most patient time travellers will eventually force-terminate the program or send themselves far back in time. If a bot is used, the devices and time traveller disappear.

Visit the Dinosaurs

0: D.U.C.K.send_abs(-235997984 * 31557600);		//Negative = BCE, Positive = CE (in most implementations). Time is approximate.
1: x = input();						//Waits as long as the user wants
2: D.U.C.K.send(0);					//Returns to the present time

Note: The above program should only be used on mobile devices with sufficient battery life. It is suspected that being eaten by a dinosaur will kill you.
Also note: This program assumes you are on Earth.

(Probably) Witness Your Species' Extinction

0: D.U.C.K.send(31557600);				//One year into the future
1: x = input();						//Wait
2: D.U.C.K.send(0);					//Return

See also