*

From Esolang
Jump to: navigation, search

* is a very simple esoteric programming language where the only commands are * and + (if you can even count that one).

  • * prints "Hello World".
  • [SPACE]*[SPACE] ([SPACE] is the space character.) prints a random number between 0 and 1 multiplied by an extremely big number. (In the Java interpreter it's the biggest number possible in Java.)
  • * + * runs forever.

Java Interpreter

import java.util.Scanner;

public class Asterisk {

	public static void main(String[] args) {

		Scanner in = new Scanner (System.in);
		System.out.println();
		String ast = in.nextLine();
		
		if (ast.equals("*")) System.out.println("Hello World");
		else if (ast.equals(" * ")) System.out.println((Math.random() * (Integer.MAX_VALUE)));
		else if (ast.equals("*+*")) recur();
	}
	public static void recur () {recur();}
}