my own little program

Sharky Forums


Results 1 to 8 of 8

Thread: my own little program

Threaded View

  1. #1
    Tiger Shark munchy1988's Avatar
    Join Date
    Sep 2002
    Location
    The Dirty Jerz
    Posts
    932

    Talking my own little program

    well, i got bored in class, and made my own little "destry the world program", u kno, the usual.

    heres to code for it. im just a beginner so its not that advanced.

    Code:
    class countries
    {
    	
    	public static void main(String[] args)
    	{		
    		int seconds = 0;
    		int countries = 0;
    		int count = 0;
    		String msg = "";
    		String msg1= "";
    		seconds = IO.getInt("How many seconds will the process take?");
    		
    		while ((seconds<1) || (seconds>50))
    		{
    			seconds = IO.getInt("Process is either too long or undefinable.  Please re-enter process time");
    		}
    		
                    countries = IO.getInt("How many countries?");
    		
    		if (countries == 1)
    		{
    			msg1+= ("1 Billion Chinese People ");
    		}
    		
    		if (countries == 2)
    		{
    			msg1+= ("China and Germany ");
    		}
    		
    		if (countries == 3)
    		{
    			msg1+= ("China, Germany, and The Pinko Commies ");
    		}
    		
    		if (countries == 4)
    		{
    			msg1+= ("China, Germany, Russia, and Japan ");
    		}
    		
    		if (countries == 5)
    		{
    			msg1+= ("China, Germany, Russia, Japan, and another third world country with terrorists ");
    		}
    		
    		if (countries == 6)
    		{
    			msg1+= ("China, Germany, Russia, Japan, France, and Mongolia ");
    		}
    		
    		if (countries > 6)
    		{
    			msg1+= (countries + " countries ");
    		}
    		
    		for (count = seconds; count > 0; count--)
    		{
    			msg +=(msg1 +"will be demolished in: " + count + '\n');
    			IO.showMsg(msg);
    			msg = new String("");
    		}
    		
    		IO.showMsg(msg1 + "are now destroyed" + '\n' + '\n' +
    					"The U.S. government has officially pwn3d you." + '\n' + '\n' +
    					"**** Cheney now owns all of your assets.  Thank you for your participation in this program.");
    		
    		System.exit(0);
    	}
    }
    well, what i want to kno is, instead of making a new IO.showMsg box appear, how can i make it count down to 0 with only the 1 box shoing up? is it even possible to do a thing like this with a time second delay?

    **i probably should have mentioned this is in java...srry about that guys.
    Last edited by munchy1988; 10-21-2004 at 07:34 PM.
    Asus S96J | ATi Mobility Radeon X1600 | T2500 Core Duo | 2 GB DDR2 667 Mhz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •