From 7a22c1be81dae4923722d2aa6ced23dbfe90147d Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Sat, 30 Sep 2017 18:32:26 -0400 Subject: [PATCH] drawing begin --- gyrio/index.html | 2 +- gyrio/index.js | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gyrio/index.html b/gyrio/index.html index d6939eb..32acc98 100644 --- a/gyrio/index.html +++ b/gyrio/index.html @@ -9,7 +9,7 @@ - + \ No newline at end of file diff --git a/gyrio/index.js b/gyrio/index.js index e69de29..d0fdbee 100644 --- a/gyrio/index.js +++ b/gyrio/index.js @@ -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); \ No newline at end of file