Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active December 22, 2021 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/5335afa41bb63e306104353c3fee485a to your computer and use it in GitHub Desktop.
Save McLarenCollege/5335afa41bb63e306104353c3fee485a to your computer and use it in GitHub Desktop.
Exercise : Winning Move for X

Given the following board variable representing a tic-tac-toe board, update the board to make the winning move for X i.e change one value of the board in such a way that X has a winning move. Do not reassign the value of board to a new array, just update a single element in the nested array.

CODE TEMPLATE


let board = [[' ', 'O', 'X'],['O', 'X', ' '], ['O', ' ', 'X']]; // Do not modify this line
// Write your code here
console.log(board);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment