
import java.awt.*;
public class LightningBolt extends Frame{
	public static void main(String[] Args){
		LightningBolt x = new LightningBolt();
		x.setVisible(true);		
	}
	public LightningBolt(){
		setSize(600,600);
		repaint();
	}
	public void paint(Graphics g){
			int sleeptime = (int)(Math.random()*10);
			try{Thread.sleep(sleeptime);}
			catch(Exception e){}
			g.setColor(Color.black);
			g.fillRect(1,1,600,600);
			g.setColor(Color.gray);
			g.fillOval(0,0,600,100);
			g.fillOval(0,20,200,70);
			g.fillOval(500,20,150,76);
			for(int i = 0; i<(int)(Math.random()*2+1);i++){
			int x = (int)(Math.random()*600+1);
			try{Thread.sleep(1000);}
			catch(Exception e){}
			g.setColor(new Color((float).55,(float)0,(float)1));
			for(int y = 95; y<=600; y+=0){
				int nexty = y + normalRandInt(100);
				int nextx = x + normalRandInt(90)-90;
				if(nextx <0 || nextx > 600) nextx = x-(nextx - x);
				g.drawLine(x,y,nextx,nexty);
				x = nextx;
				y = nexty;
				try{Thread.sleep(80);}
				catch(Exception e){}
			}
			}
			try{Thread.sleep(1000);}
			catch(Exception e){}
			repaint();
	}
	public int normalRandInt(int multiplier){
		int nextInt = (int)((Math.random() + Math.random())*multiplier);
		return nextInt;
	}
}

