- public class Test{
- public static void main(String[] args) {
- // Crée un high Score avec 2 colonnes triées en majeur et décroissant
- // sur les scores (la seconde colonne) et en mineur sur les noms. Le
- // high Score comportera au maximum 10 lignes et le tout est enregistré
- // dans un fichier "HighScore.txt" en utilisant le délimiteur
- // ":" pour séparer les infos dans le fichier.
-
- HighScore hs = new HighScore(new String[]{"Nom","Score"},new int[][]
- {{1,0},{0,1}},10,"HighScore.txt",":");
-
- hs.addLigne(new Comparable[]{new String("Nico"),
- Integer.valueOf("10")});
- hs.addLigne(new Comparable[]{new String("Frep"),
- Integer.valueOf("20")});
- hs.addLigne(new Comparable[]{new String("Max"),
- Integer.valueOf("20")});
- for(int i=0;i<hs.getNbLines();i++)
- System.out.println(hs.getLigne(i)[0] + "\t"+hs.getLigne(i)[1]);
- }
- }
-
-
public class Test{
public static void main(String[] args) {
// Crée un high Score avec 2 colonnes triées en majeur et décroissant
// sur les scores (la seconde colonne) et en mineur sur les noms. Le
// high Score comportera au maximum 10 lignes et le tout est enregistré
// dans un fichier "HighScore.txt" en utilisant le délimiteur
// ":" pour séparer les infos dans le fichier.
HighScore hs = new HighScore(new String[]{"Nom","Score"},new int[][]
{{1,0},{0,1}},10,"HighScore.txt",":");
hs.addLigne(new Comparable[]{new String("Nico"),
Integer.valueOf("10")});
hs.addLigne(new Comparable[]{new String("Frep"),
Integer.valueOf("20")});
hs.addLigne(new Comparable[]{new String("Max"),
Integer.valueOf("20")});
for(int i=0;i<hs.getNbLines();i++)
System.out.println(hs.getLigne(i)[0] + "\t"+hs.getLigne(i)[1]);
}
}