MCPcopy Index your code
hub / github.com/python-websockets/websockets / createBoard

Function createBoard

example/tutorial/step3/connect4.js:5–24  ·  view source on GitHub ↗
(board)

Source from the content-addressed store, hash-verified

3const PLAYER2 = "yellow";
4
5function createBoard(board) {
6 // Inject stylesheet.
7 const linkElement = document.createElement("link");
8 linkElement.href = import.meta.url.replace(".js", ".css");
9 linkElement.rel = "stylesheet";
10 document.head.append(linkElement);
11 // Generate board.
12 for (let column = 0; column < 7; column++) {
13 const columnElement = document.createElement("div");
14 columnElement.className = "column";
15 columnElement.dataset.column = column;
16 for (let row = 0; row < 6; row++) {
17 const cellElement = document.createElement("div");
18 cellElement.className = "cell empty";
19 cellElement.dataset.column = column;
20 columnElement.append(cellElement);
21 }
22 board.append(columnElement);
23 }
24}
25
26function playMove(board, player, column, row) {
27 // Check values of arguments.

Callers 1

main.jsFile · 0.90

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…