import java.util.*; class Game { Scanner sc = new Scanner(System.in); int[] ar = new int[3]; int[] guess = new int[3]; int location() { for(int i=0;i<3;i++) { ar[i] = sc.nextInt() ; } } int userGuess() { for(int j=0;j<3;j++) { guess[j] = sc.nextInt() ; } } int Comparison() { for(int k=0;k<3;k++) { if(ar[k] == guess[k] ) { System.out.println("hit"); } else { System.out.println("miss"); } } } public static void main(String... ar) { Game g = new Game(); g.location(); g.userGuess(); g.Comparison(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)