package scores;

import java.util.Random;
import java.util.Scanner;
/**
 * Main class for running the application
 * @author Johan Brunet, Julien Gallego
 *
 */
public class TestHighScore3 {
	/**
	 * The ThingSpeak URL to connect to in order to retrieve data
	 */
	public static final String THINGSPEAK_FEED_URL = "https://api.thingspeak.com/channels/109693/feeds.csv";
	
	/**
	 * Main of the application
	 * @param args some arguments
	 */
	public static void main(String[] args) {
		String playerName;
		HighScore3 highScore = new HighScore3(THINGSPEAK_FEED_URL);
		BestPlayer3[] top;
		
		Scanner scan = new Scanner(System.in);
		System.out.println("> Please enter a player name");
		if (scan.hasNext()) {
			playerName = scan.nextLine();
		}
		scan.close();
		
		Random rand = new Random();
		
		top = highScore.tenBestScores(highScore.getScores());
		BestPlayer3 player = top[rand.nextInt(10)];
		player.setName("test");
		player.setScore(player.getScore()*10);
		
		
		int i;
		for (i = 0; i < top.length; i++) {
			if(top[i] != null) {
				System.out.println((i+1) + " - " + top[i].getName() + " : " + top[i].getScore());
			}
		}
	}
}

@@ -962,16 +962,94 @@
 *10);%0A%09%09
+if (player.getScore()%3Etop%5B10%5D.getScore())%7B%0A%09%09%09highScore.sendScore(player);%0A%09%09%7D
 %0A%09%09%0A%09%09in

Add Test in TestHighScore3