Advertisement
Guest User

Untitled

a guest
Sep 8th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Input.
  2. let input = [
  3.   'f',
  4.   '3'
  5. ];
  6.  
  7. // Custom implementation of read and print. Do not touch : )
  8. let print = this.print || console.log;
  9. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  10.  
  11. // Solution
  12. let label = gets();
  13. let rank = gets();
  14.  
  15. if (label === "a" || label === "c" || label === "e" || label === "g") {
  16.   if (rank === "1" || rank === "3" || rank === "5" || rank === "7")
  17.   console.log("dark");
  18. }
  19. else if (label === "a" || label === "c" || label === "e" || label === "g") {
  20.   if (rank === "2" || rank === "4" || rank === "6" || rank === "8")
  21.   console.log("light");
  22. }
  23. else if (label === "b" || label === "d" || label === "f" || label === "h") {
  24.   if (rank === "1" || rank === "3" || rank === "5" || rank === "7")
  25.   console.log("light");
  26. }
  27. else if (label === "b" || label === "d" || label === "f" || label === "h") {
  28.   if (rank === "2" || rank === "4" || rank === "6" || rank === "8")
  29.   console.log("dark");
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement