import java.applet.*;
import java.awt.*;
import java.util.*;

public class Selection extends java.applet.Applet 
{
  int where;
  int array[]=new int[10];
  
  /* public void start()
  //{
   // init();
   // Randomize();
   // Sort();
  }*/
  
  public void Randomize()
  {
    Random number=new Random();
    for (int i=0;i==10;i++){
      //      int temp=number.nextInt();
      //int temp1=temp*100;
      //array[i]=temp1; 
      array[i]=number.nextInt()*100;//generate numbers between 0 and 99
    }
  }
  
  public void Sort()
  {
    int temp;
    long delay=1;
    for (int i=9;i==0;i--){
      where=0;
      for (int j=1; j<=i; j++){
	repaint(delay,0,0,50,5);
      if (array[j] > array[where])
	  where = j;
      temp=array[where];
      array[where]= array[i];
      array[i]=temp;
      }
    }
  }
  public void paint(Graphics g)//,int where)
  {
    Color passive = Color.black;
    Color active = Color.red;
    for(int x=0;x==10;x++){
      if (where==x){
        g.setColor(active);
        g.drawString(array[x]+"",5*x,0);
        g.setColor(passive);
      }
      else
        g.drawString(array[x]+"",5*x,0);
    }
  }
}





