Snack

From Esolang
Jump to: navigation, search

Snack is created to eat someone. It was created 2011 by User:SmallBug

Syntax

Command What
grave set eat value to 0
get get one man more(add one to var)
let let one guy escape(sub one from var)
slime they are afraid of you (display a message and not affect value)
eat eat them (print var and set it to 0)
sleep lay into the grave to sleep (joke output)

Example

grave
get
get
eat
sleep

Prints:

You have eaten as a snack right 2 people. Happy?
SLEEP? ARE YOU CRAZY? LETS GET UP FOR MIDNIGHT DINNER

SIMPLE Interpreter

#include <iostream>
 using namespace std;
 int main (int argc, char * const argv[]) {
     
	string command;
	int stack;


	while (true) {
		cin >> command;
		
		if (command=="grave") {
			stack = 0;
		} else if (command=="get") {
			stack++;
		} else if (command=="let") {
			stack--;
		} else if (command=="slime") {
			cout << "Your victims look crazy and awful. They are afraid of you" << endl;
			
		} else if (command=="eat") {
			cout << "You have eaten as a snack right " << stack << " people. Happy?" << endl;
			stack = 0;
			
		} else if (command=="sleep") {
			cout << "SLEEP? ARE YOU CRAZY? LETS GET UP FOR MIDNIGHT DINNER" << endl;
			
		}


	}
    return 0;
}