fork download
  1. import java.util.Random;
  2. class Main {
  3. private static final Random random = new Random();
  4.  
  5. private static final String[] SHAPES = {
  6. "square", "circle", "cone", "prism", "cube", "cylinder", "triangle",
  7. "star", "moon", "parallelogram"
  8. };
  9.  
  10. public static String randomShapeWord() {
  11. return SHAPES[random.nextInt(SHAPES.length)];
  12. }
  13.  
  14. public static void main(String[] args) {
  15. for (int i = 0; i < 20; i++) {
  16. System.out.println(randomShapeWord());
  17. }
  18. }
  19. }
  20.  
  21.  
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
parallelogram
parallelogram
square
circle
cone
moon
star
parallelogram
moon
cube
parallelogram
cube
square
parallelogram
triangle
star
parallelogram
cube
triangle
cone