Thread: What is your favorite piece of code?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    859

    What is your favorite piece of code?

    Mine is:

    Code:
    #include<stdio.h>
    #include<conio.h>
    #include<stdlib.h>
    #include<iostream.h>
    
    void hell(char* sacrifice)
    {
    	char frag;
    	cout << "You are in hell";
    	if (sacrifice == "N" || sacrifice == "n")
    		cout <<"There is no way you can get out";
    	do{
    		if (kbhit())
    		{
    			frag = getch();
    			if (frag == 3) // Ctrl + C detection
    				cout << "How dare you use the ^C function!!";
    			if (sacrifice == "N" || sacrifice == "n")
    				for(; 1!=1;);
    			if (sacrifice != "N" || sacrifice != "n")
    				cout << "Thank you!!";
    		}
    	}while(sacrifice == "N" && sacrifice == "Y");
    	system("PAUSE");
    }
    
    main()
    {
    	char* sacrifice;
    	cout << "Want to sacrifice something important?(Y / N) ";
    	cin >> sacrifice;
    	if (sacrifice == "N" || sacrifice == "n")
    	{
    		hell(sacrifice);
    	}
    	else if (sacrifice == "Y" || sacrifice == "y")
    	{
    		cout << "What do you want to sacrifice? ";
    		cin >> sacrifice;
    		hell(sacrifice);
    	}
    	else
    	{
    		sacrifice = "N";
    		hell(sacrifice);
    	}
    	return 0;
    }
    Mind you.
    :p
    Last edited by Yoshi; 01-21-2002 at 06:59 PM.
    Yoshi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. whats wrong with this piece of code?
    By psycho88 in forum C Programming
    Replies: 3
    Last Post: 12-03-2005, 11:28 PM
  2. Help with a piece of code
    By Victor4015 in forum C++ Programming
    Replies: 1
    Last Post: 11-16-2005, 05:38 PM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM