/*import java.awt.*;
import java.applet.*;


public class AppletExperiment extends Applet {
	
	private String str="";
	
	public void init() {
	//	str+="init ";
	}
	
	public void paint(Graphics g) {
		Dimension d=this.getSize();
		int w=d.width;
		int h=d.height;
		double x;
		int y=0;
		double val;
		final double MIN=-Math.PI;
		final double MAX=Math.PI;
		final int POINTS=100;
		double[] xs=new double[POINTS+1];
		double[] ys=new double[POINTS+1];
		double dX=(MAX-MIN)/POINTS;
		for (x=MIN; x<=MAX; x+=dX){		
			xs[y]=x;	
			ys[y]=(double)(Math.sin(x)+0.5*Math.sin(2*x)+Math.sin(3*x)/3.0+Math.sin(4*x)/4.0);
			y++;
			//System.out.println("("+x+","+ys[y-1]+")");
		}
		int[] reAlignedX=new int[POINTS+1];
		int[] reAlignedY=new int[POINTS+1];
		for (y=0; y<POINTS+1; y++){
			reAlignedX[y]=(int)((xs[y]+(double)(w/2))-(w/2-xs[y]));
			reAlignedY[y]=(int)((ys[y]+(double)(h/2))-(h/2-ys[y]));
			System.out.println("("+reAlignedX[y]+","+reAlignedY[y]+")");
		}
		for (y=0; y<POINTS; y++){
			g.drawLine(reAlignedX[y],reAlignedY[y],reAlignedX[y+1],reAlignedY[y+1]);
		}
		
	}
}
*/

import java.awt.*;
import java.applet.*;
import java.util.*;

public class AppletExperiment extends Applet {
	
	private String str="";
	
	public void init() {
		//initializing nothing!  cool!
	}
	
	public void paint(Graphics g) {
		g.drawString("Password Generator",1,15);
		g.drawString("By upessimist (#178125)",1,30);
		int x;
		 int rand;
		 Random rnd=new Random();
		 rand=rnd.nextInt(11);
		 rand+=6;
		 char[] pw=new char[rand];
		 for (x=0; x<rand-3; x++){
		 	if (rnd.nextInt(2)==0){
		 	 	pw[x]=(char)rnd.nextInt(26);
		 	 	pw[x]+=65;
		 	 }
		 	 else{
		 	 	pw[x]=(char)rnd.nextInt(26);
		 	 	pw[x]+=97;
		 	 }
		 }
		 for (x=rand-3; x<rand; x++){
		 	pw[x]=(char)rnd.nextInt(10);
		 	pw[x]+=48;
		 }
		 int temp=rnd.nextInt(5);
		 temp+=3;
		 int temp2;
		 char tChar;
		 for (int y=0; y<temp; y++){
		 	for (x=0; x<rand; x++){
		 		temp2=rnd.nextInt(rand);
		 		tChar=pw[temp2];
		 		pw[temp2]=pw[x];
		 		pw[x]=tChar;
		 	}
		}
		for (x=0; x<rand; x++)
			str+=pw[x];
		g.drawString("Your password is: "+str,1,45);
	}
}
