Advertisement
Guest User

Untitled

a guest
Apr 6th, 2021
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. import java.math.*;
  4.  
  5. /**
  6.  * The while loop represents the game.
  7.  * Each iteration represents a turn of the game
  8.  * where you are given inputs (the heights of the mountains)
  9.  * and where you have to print an output (the index of the mountain to fire on)
  10.  * The inputs you are given are automatically updated according to your last actions.
  11.  **/
  12. class Player {
  13.  
  14.     public static void main(String args[]) {
  15.         Scanner in = new Scanner(System.in);
  16.        
  17.  
  18.         // game loop
  19.         while (true) {
  20.             for (int i = 0; i < 8; i++) {
  21.                 int mountainH = in.nextInt();
  22.                 System.out.println(i); // represents the height of one mountain.
  23.             }
  24.  
  25.             // Write an action using System.out.println()
  26.             // To debug: System.err.println("Debug messages...");
  27.             // The index of the mountain to fire on.
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement