/** * Author: Josiah Yoder et al. * Class: SE1011-011 * * * This is a temporary class for just trying things out. * Nothing that's here is likely to stay here for long. */ import com.t00ter.T00t; import java.util.*; public class Sandbox { public static void main(String[] string) { pickLuckyTeam(); } public static void autoboxingWithArraylists() { // Auto-boxing example ArrayList numbers = new ArrayList(); numbers.add(5.0); for(double number : numbers) { System.out.println(number); } } public static void iteratorExamplesWithT00t() { // T00t iterator example. ArrayList toots = new ArrayList(); toots.add(new T00t(1,"t00ter","This is a t00t, and this is another t00t. Can you find them?", new Date())); toots.add(new T00t(1,"t00ter","And this is another t00t with lots of T00ts in it. Can you find this t00T?", new Date())); // You could also go through all the T00ts like this: for(T00t toot : toots) { // Use the toot for something } // Or you could get an iterator and do the same thing. Iterator it = toots.iterator(); while(it.hasNext()) { T00t toot = it.next(); //Do something with the t00t. } } public static void pickLuckyTeam() { Scanner scanner = new Scanner(System.in); System.out.print("Enter the number of teams: "); int n; n = scanner.nextInt(); Random generator = new Random(); int luckyTeam = generator.nextInt(n)+1; System.out.println("The lucky team is: "+luckyTeam); } }