Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Chess {
- public static void main(String[] args) {
- Scanner userInput = new Scanner(System.in);
- String label = userInput.nextLine();
- int rank = userInput.nextInt();
- if (label.equals("a") || label.equals("c") || label.equals("e") || label.equals("g")) {
- if (rank % 2 == 0) {
- System.out.println("dark");
- }
- } else if (label.equals("b") || label.equals("d") || label.equals("f") || label.equals("h")) {
- if (rank % 2 >= 0) {
- System.out.println("dark");
- }
- } else {
- System.out.println("light");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement