prompt = {
	out prompt_msg + "> ";
};

error = {
	out "! " + error_msg + "\n\n";
};

output = {
	out output_msg + "\n\n";
};

# A boring counter...
counter = 0;
counter_loop = {
	counter = counter + 1;
	prompt_msg = counter; prompt; in command;
	
	if { command != "exit"; } counter_loop;
	
	# Time to exit:
	if { command == "exit"; } {
		command = ""; known = 1;
	};
};

# Start the main loop:
command_loop = {
	prompt_msg = ""; prompt; in command; known = 0;
	
	# No command...
	if { command == ""; } command_loop;
	
	# What to do?
	if { command == "counter"; } { counter_loop; };
	if { command == "exit"; } { known = 1; };
	
	# We couldn't handle the command:
	if { known == 0; } {
		error_msg = "Unknown command!"; error;
	};
	
	# Time to exit:
	if { command != "exit"; } command_loop;
};

command_loop;