Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: main.c
- * Author: mateusz
- *
- * Created on 22 lipiec 2011, 23:09
- */
- #include <stdio.h>
- #include <stdlib.h>
- #ifdef _WIN32
- # include <windows.h>
- #else
- # include <unistd.h>
- #endif
- #ifdef _WIN32
- # define CLEAR system("cls")
- # define SLEEP Sleep(2000)
- #else
- # define CLEAR system("clear")
- # define SLEEP sleep(2)
- #endif
- int menu();
- int main(int argc, char** argv) {
- int choice_;
- printf("Welcome to my world.\n"
- "What will you do?\n\n");
- while(1) {
- choice_ = menu();
- switch(choice_) {
- case 1:
- printf("Boom!");
- return 0;
- SLEEP;
- CLEAR;
- system("exit");
- case 2:
- printf("You kill yourself. You moron.\n");
- printf("Few seconds later, identical clone appears in your place.\n");
- SLEEP;
- CLEAR;
- break;
- case 3:
- printf("You try to run away, but the place looks like it has no "
- "boundaries. You eventually die.\n");
- printf("Few seconds later, identical clone appears in your place.\n");
- SLEEP;
- CLEAR;
- break;
- default:
- printf("Wrong choice, try again.\n");
- SLEEP;
- CLEAR;
- }
- }
- getchar();
- return 0;
- }
- int menu() {
- int choice;
- printf("1. Destroy this place.\n"
- "2. Kill myself.\n"
- "3. Get out from here.\n"
- "> ");
- scanf("%d", &choice);
- return choice;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement