Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Input.
- let input = [
- 'f',
- '3'
- ];
- // Custom implementation of read and print. Do not touch : )
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- // Solution
- let label = gets();
- let rank = gets();
- if (label === "a" || label === "c" || label === "e" || label === "g") {
- if (rank === "1" || rank === "3" || rank === "5" || rank === "7")
- console.log("dark");
- }
- else if (label === "a" || label === "c" || label === "e" || label === "g") {
- if (rank === "2" || rank === "4" || rank === "6" || rank === "8")
- console.log("light");
- }
- else if (label === "b" || label === "d" || label === "f" || label === "h") {
- if (rank === "1" || rank === "3" || rank === "5" || rank === "7")
- console.log("light");
- }
- else if (label === "b" || label === "d" || label === "f" || label === "h") {
- if (rank === "2" || rank === "4" || rank === "6" || rank === "8")
- console.log("dark");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement