CVGalleryGamesPreviewRandomJavaSiteWeb
Site updates
Testing New System now...

Funny Name

Funny Name asks you to enter your name, then pretends it couldn't hear you properly.

Download:
FunName.java - command line
FunName.class - command line

FunNameS.java - Swing
FunName class zip - Swing

FunNameJA.java - JApplet
FunNameJA.class - JApplet
import java.io.*;

public class FunName
{
    
    public static void main(String[] args) throws IOException
    {
	BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
	    
	System.out.println("Enter your full name:");
	String name = input.readLine();
	
	String name2 = new String();

	for(int i=0; i<name.length(); i++)
	    {                              
		if ((int)(Math.random()*3) == 2)  This gives a 1 in 3 chance of the letter being changed.
		    {                             
			name2 = name2 + "m";
		    }
		else
		    {
			name2 = name2 + name.charAt(i);
		    }
	    }    
	System.out.println(name2 + "? You'll have to speak up!");
    }
}
NOTE: The Java section is mostly in maintenence mode. I don't have time to work on it right now. Errors will be corrected if pointed out, but they are not actively being searched for. Newer site features, like alternate stylesheets, may cause problems with these pages.