Skip to content

Instantly share code, notes, and snippets.

View angle943's full-sized avatar

Justin Kim angle943

  • AWS
  • Seattle
  • 06:52 (UTC -07:00)
View GitHub Profile
@angle943
angle943 / app.js
Created April 4, 2020 05:26
Connect Four app.js
// DOM Elements
const allCells = document.querySelectorAll('.cell:not(.row-top)');
const topCells = document.querySelectorAll('.cell.row-top');
const resetButton = document.querySelector('.reset');
const statusSpan = document.querySelector('.status');
// columns
const column0 = [allCells[35], allCells[28], allCells[21], allCells[14], allCells[7], allCells[0], topCells[0]];
const column1 = [allCells[36], allCells[29], allCells[22], allCells[15], allCells[8], allCells[1], topCells[1]];
const column2 = [allCells[37], allCells[30], allCells[23], allCells[16], allCells[9], allCells[2], topCells[2]];