20
4
The task is simple. Write an interpreter for the language *.
Here's a bigger link to the wiki.
There are only three valid * programs:
*
Prints "Hello World"*
Prints a random number between 0 and 2,147,483,647*+*
Runs forever.
The third case must be an infinite loop according to the specifications in this question
Input:
- The input can be taken via any acceptable input method by our standard I/O rules
- It will always be one of the above programs
Output:
- The first case should print exactly
Hello World
, with or without a trailing line break. - For the second case, if your language's integer maximum is smaller than 2,147,483,647, use your language's integer maximum
- The first and second cases can print to any acceptable output by our standard I/O rules.
- The third case should not give any output.
Scoring:
As this is code-golf, the shortest answer, in bytes, wins.
7When you say 'between
0
and2,147,483,647
', is that inclusive or exclusive? (E.g., is0
a valid output?) – Chas Brown – 2019-08-09T21:46:14.4631@Chas the linked wiki has interpreters in Java & JS which include
0
. – Jonathan Allan – 2019-08-09T22:48:25.050For the random number generation, can the program output whitespace in addition to the number? – None – 2019-08-10T06:38:51.193
7Changing the spec after posting a challenge and invalidating existing solutions is an automatic
-1
from me. – Shaggy – 2019-08-10T07:00:02.2702For languages that don't have a built-in way of generating a random number, is there an acceptable way to satisfy the "print a random number" requirement? – Tanner Swett – 2019-08-10T22:44:28.410
2If our language's integers have no, or a higher, maximum may we use a higher upper bound? – Jonathan Allan – 2019-08-10T23:43:49.223
@JonathanAllan No, you may not. – TheOnlyMrCat – 2019-08-11T19:59:24.277
7@Shaggy I'm not seeing any rule changes in the wiki for the question, only a space to a non-breaking space (check the markdown tab), because the SE markdown renderer wasn't rendering it, but looking at the original revisision, it's clear it should be normal spaces, and the "hack' is only done for SE markdown renderer issues – Ferrybig – 2019-08-11T20:49:29.710