Skip to content

Instantly share code, notes, and snippets.

View deanclark1's full-sized avatar
🪴
Looking for new opportunities to grow

Doreen Ntumy deanclark1

🪴
Looking for new opportunities to grow
View GitHub Profile
const readline = require("readline-sync");
let Player = 'X';
let ticktacktoe = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '];
const defaultPlayer = () => {
choice = readline.question("Default player is X, Do you want to change it, y or n ");
if (choice == 'y') {
let changeDefault = readline.question("Enter O to change it ").toUpperCase();
if(changeDefault == 'O' || changeDefault === 'X'){