Compare commits

..

No commits in common. "270d7c5bfe017f27f9a1eaeb611d724721b344d1" and "0fac72a5a8b1cb9578b4af4fae786f1f8c6e3443" have entirely different histories.

3 changed files with 46 additions and 88 deletions

View File

@ -1,13 +1,49 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exercises</title> <title>Exercises</title>
</head> </head>
<body> <body>
<h1>Please reopen the IDE by pointing to the folder for each week</h1> <h1>Week1</h1>
<ul>
<li><a href="w1_types">Types</a></li>
</ul>
<h1>Week2</h1>
<ul>
<li><a href="w2_p5">p5.js</a></li>
<li><a href="w2_arrays">Arrays</a></li>
</ul>
<h1>Week3</h1>
<ul>
<li><a href="w3_functions">Functions</a></li>
<li><a href="w3_turtle">Recursion: Turtle</a></li>
<li><a href="w3_tower">Recursion: Tower of Hanoi</a></li>
</ul>
<h1>Week4</h1>
<ul>
<li><a href="w4_watch">Watch</a></li>
<li><a href="w4_HOF">HOF</a></li>
</ul>
<h1>Week7</h1>
<ul>
<li><a href="w7_lights">Lights</a></li>
<li><a href="w7_cars">Cars</a></li>
</ul>
<h1>Week8</h1>
<ul>
<li><a href="w8_factory/">Factory</a></li>
</ul>
<h1>Week10</h1>
<ul>
<li><a href="w10_files_browser/">Files+browser</a></li>
<li><a href="w10_node/">Node</a></li>
<li><a href="w10_promises/">Promises</a></li>
</ul>
</body> </body>
</html> </html>

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script src="../libs/js/p5.js"></script>
<script src="../libs/js/p5.dom.min.js"></script>
<script src="../libs/js/p5.sound.min.js"></script>
<meta charset="utf-8" />
<style>
/* Center the canvas */
canvas {
display: block;
margin: 0 auto;
}
</style>
</head>
<script defer src="./sketch.js"></script>
<body></body>
</html>

View File

@ -1,57 +0,0 @@
// Main
const N = 10;
let strips = [];
function setup() {
createCanvas(400, 300);
strips = createStrips(N);
}
function draw() {
background(0);
noStroke();
const stripHeight = height / strips.length;
for (let i = 0; i < strips.length; i++) {
// draw the strips
// const r = ...
}
}
// HELPERS
/**
*
* @typedef {{red:number, green:number, blue:number}} Color
*/
/**
* createRndColorStrip
* @returns Color
*/
function createRndColorStrip() {
return {
red: Math.floor(Math.random() * 255),
green: Math.floor(Math.random() * 255),
blue: Math.floor(Math.random() * 255),
};
}
/**
* getLuminance -- get luminance given an array of Color
* @param {Color} strip
* @returns number
*/
function getLuminance(strip) {
// PLACEHOLDER - return the luminance of the strip
return 0;
}
/**
* createStrips -- create an array of random colors
* @param {number} n
* @returns Color[]
*/
function createStrips(n) {
// PLACEHOLDER - return an arrray of strips of colors
return [];
}