package scores;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class TestHighScore1 {
	public static final String THINGSPEAK_URL = "https://api.thingspeak.com/channels/109692/feeds.csv";
	
	public static void main(String[] args) {
		String playerName;
		int score;
		HighScore1 highScore = new HighScore1(THINGSPEAK_URL);
		
		Scanner scan = new Scanner(System.in);
		System.out.println("> Please enter a player name");
		if (scan.hasNext()) {
			playerName = scan.nextLine();
		}
		else {
			playerName = "default";
		}
		scan.close();
		ArrayList<Integer> scores = new ArrayList<Integer>(highScore.getScores());
		score = scores.get(getRandInt(scores.size()));
		
		System.out.println("Player : " + playerName);
		System.out.println("Score : " + score);
	}
	
	private static int getRandInt(int bound) {
		Random rand = new Random();
		return (int)(rand.nextInt(bound));
	}
}

@@ -90,16 +90,38 @@
 anner;%0A%0A
+import utils.Parser;%0A%0A
 public c
@@ -609,73 +609,206 @@
 ist%3C
-Integer%3E scores = new ArrayList%3CInteger%3E(highScore.get
+String%3E dataToParse = new ArrayList%3CString%3E(highScore.getScores());%0A%09%09ArrayList%3CInteger%3E scores = new ArrayList%3CInteger%3E();%0A%09%09for (String s : dataToParse) %7B%0A%09%09%09scores.add(Parser.parse
 Score
-s
 (
+s
 ));%0A
+%09%09%7D%0A
 %09%09sc
@@ -855,16 +855,120 @@
 )));%0A%09%09%0A
+%09%09int i = 0;%0A%09%09for (int sc : scores) %7B%0A%09%09%09System.out.println(%22Score %22 + i + %22 : %22 + sc);%0A%09%09%09i++;%0A%09%09%7D%0A%09%09%0A
 %09%09System

Modify display