import structure.*; import element.*; import java.util.Random; public class Poetry { public static void main(String args[]) { ConsoleWindow c = new ConsoleWindow(); Random g = new Random(); final int max = 100; String poem[] = new String[max]; int count; String line; int i; count = 0; while (!c.input.eof()) { poem[count] = c.input.readLine(); count++; } /* count = 0; while ((count < max) && (!c.input.eof())) { poem[count] = c.input.readLine(); count++; } */ /* int i; for (i = 0; i < count; i++) { c.out.println(poem[i]); // print line i } */ int lines = count; int selected; while (lines > 0) { // pick a line number from 0 to lines-1 selected = Math.abs(g.nextInt())%lines; // print the selected line c.out.println(poem[selected]); // overwrite selected line with last line poem[selected] = poem[lines-1]; // decrement logical # of lines remaining lines--; } } } /* To make a prairie it takes a clover and one bee,-- One clover, and a bee, And revery. The revery alone will do If bees are few. The revery alone will do If bees are few. One clover, and a bee, And revery. and one bee,-- To make a prairie it takes a clover */