Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tutorial-conway-life-t1
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COSC360 in 2018
tutorial-conway-life-t1
Commits
1ab924f6
Commit
1ab924f6
authored
6 years ago
by
Will Billingsley
Browse files
Options
Downloads
Patches
Plain Diff
Removed key parts of code for tutorial
parent
b857b969
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+1
-1
1 addition, 1 deletion
index.html
render.js
+1
-27
1 addition, 27 deletions
render.js
with
2 additions
and
28 deletions
index.html
+
1
−
1
View file @
1ab924f6
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
render.js
+
1
−
27
View file @
1ab924f6
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment