Fun Video Game

From Esolang
Jump to navigation Jump to search

Fun Video Game is a simple program originating from a tweet by Jack Eisenmann in 2018. It plays an extremely fun video game in which the player must input integers starting from 0 and counting upwards (0, 1, 2, and so on). If the player fails to correctly input the next number in the sequence, the string "FAILURE" is printed and the game ends.

Implementations

Python

Here is the Python 2 implementation from the original tweet:

number = 0
while True:
    if int(raw_input()) != number:
        print "FAILURE"
        break
    number += 1

Here is a Python 3 implementation:

number = 0
while int(input()) == number:
    number += 1
print("FAILURE")

C

#include <stdio.h>
typedef unsigned long ulong;

int main(){
    ulong number=0;
    ulong input=0;
    while(scanf("%lu",&input), number==input) {
        number++;
    }
    printf("FAILURE");
    return 0;
}

Befunge

v      >0"ERULIAF">:#,_@
>0>:&\-|
  ^  +1<

External links

The original tweet from Jack Eisenmann, containing a Python 2 implementation