disinclined.org
/
git
/
cellular-automaton.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
style fixes
[cellular-automaton.git]
/
1d.js
diff --git
a/1d.js
b/1d.js
index
ed76608
..
5ead70f
100644
(file)
--- a/
1d.js
+++ b/
1d.js
@@
-17,8
+17,8
@@
$(document).ready(function(){
var canvas = document.getElementById('1d-automaton')
var c = canvas.getContext('2d');
var canvas = document.getElementById('1d-automaton')
var c = canvas.getContext('2d');
- var cellWidth =
canvas.width / cells
;
- var cellHeight =
canvas.height / generations
;
+ var cellWidth =
Math.floor(canvas.width / cells)
;
+ var cellHeight =
Math.floor(canvas.height / generations)
;
var generation = 0;
function cell(x, y, h, l) {
var generation = 0;
function cell(x, y, h, l) {