drawing begin

This commit is contained in:
Kenneth Jao 2017-09-30 18:32:26 -04:00
parent 3294d11a12
commit 7a22c1be81
2 changed files with 24 additions and 1 deletions

View File

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<canvas id="glCanvas"></canvas>
<canvas id="canvas"></canvas>
</body>
<script src="./index.js"></script>
</html>

View File

@ -0,0 +1,23 @@
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = screen.width;
canvas.height = screen.height;
function randInt(min,max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function generateString() {
var final = "";
var length = randInt(50,100);
for(var i = 0; i < length; i++) {
final += randInt(0,1);
}
return final;
}
console.log(generateString());
ctx.fillStyle = "#000";
ctx.fillRect(0,0, canvas.width, canvas.height);