Skip to content
Snippets Groups Projects
Commit 1ab924f6 authored by Will Billingsley's avatar Will Billingsley
Browse files

Removed key parts of code for tutorial

parent b857b969
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
<div id="game" style="font-family: monospace; cursor: pointer;">
</div>
<div>
<button onclick="javascript: { gameOfLife.stepGame(); render(); }">Step</button>
<button>Step</button>
</div>
......
......@@ -2,32 +2,6 @@
function render() {
let gameDiv = document.getElementById("game")
gameDiv.innerHTML = ""
for (let y = 0; y < gameOfLife.getH(); y++) {
let row = document.createElement("div")
row.setAttribute("class", "gamerow")
gameDiv.appendChild(row)
for (let x = 0; x < gameOfLife.getW(); x++) {
let t = document.createElement("span")
if (gameOfLife.isAlive(x, y)) {
t.innerHTML = "#"
} else {
t.innerHTML = "."
}
let handler = function(evt) {
gameOfLife.toggleCell(x, y)
render()
}
t.addEventListener("mousedown", handler)
row.appendChild(t)
}
}
// You need to write this
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment