chapter7/tweetshirt.js
// Draws a square at a random location
Draws a square at a random location
Draws a square at a random location
function drawSquare(canvas, context) {
	var w = Math.floor(Math.random() * 40);    
	var x = Math.floor(Math.random() * canvas.width);
	var y = Math.floor(Math.random() * canvas.height);
	context.fillStyle = "lightblue";
	context.fillRect(x, y, w, w);
}
function drawSquare ( canvas , context ) { var w = Math . floor ( Math . random ( ) * 40 ) ; var x = Math . floor ( Math . random ( ) * canvas . width ) ; var y = Math . floor ( Math . random ( ) * canvas . height ) ; context . fillStyle = "lightblue" ; context . fillRect ( x , y , w , w ) ; }
Draws a square at a random location
Draws a square at a random location
// Use this fillStyle instead if you want to try // "twitter blue" //context.fillStyle = "rgb(0, 173, 239)";