Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readline = require('readline');
- const rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout
- });
- function ham() {
- rl.question('Nhap vi tri truc X ', function (A) {
- rl.question('Nhap vi tri truc y ', function (B) {
- $pass = 1 <= A <= 8 && 1 <= B <= 8;
- if (A == '' || B == '' || !$pass) {
- console.log('Vi tri sai');
- ham();
- return;
- } else if ((A % 2 == 0 && B % 2 == 0) || (A % 2 != 0 && B % 2 != 0)) {
- console.log('Black');
- } else {
- console.log('White')
- }
- rl.close();
- });
- });
- }
- ham();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement