Weeks 8 - 11 - JavaScript topics: random numbers, arrays, objects, events


Friday April 6th: special assignment.

Assignment #5 -- due date postponed until Monday, March 26th. (And there's a chance for extra credit if you want to take it further -- see addendum at end of assignment),

multDOM a beginnning ( or another)

windows, location and frames

Case studies: building images from scratch ,

Appending and removing rows of a table

Event handlers -- assigning dynamically using function(){}(and traversing nodes)

more about events

Things you really ought to know:

random numbers, (teleology, mechanism and pragmatism) and evaluating a random number generator

why this approach to sampling with replacement is bad

Sampling different sorts of things (following up on lecture of  Mar. 30th)

array management

measuring the screen

try and catch

time

moving right across a table


Discussion of sample projects for final project (samples only) -- emphases on graphics (2D and or 3D), animation, puzzles,  fancy JavaScript.

Possible directions


2nd Quiz: Wednesday April 11th


Assignment #6:  due Monday April 16th. Do all three parts.

Assignment #6A: Image Scrambler --

Draw either a tree or a face. Your drawing should each be exactly 600 pixels by 600 pixels in size, and in either .jpg or .png format. Make the picture as realistic as you can (work no more than three hours on it). Slice the image into nine pieces, each 200 pixels square. Create a 3 by 3 table containing the nine pieces. Whenever someone clicks a button, randomly scramble the nine pictures, taking care that each picture appears only once.

Assignment #6B: Puzzle of 35 --

Draw either a tree or a face. Your drawing should each be exactly 600 pixels by 600 pixels in size, and in either .jpg or .png format. Make the picture as realistic as you can. Slice the image into 36 pieces, each 100 pixels square. Create a 6 by 6 table containing 35 of the 36 pieces (in some scrambled and random order) with one remaining cell left blank. Whenever someone clicks on a picture next to the blank cell (either above, left, right or below it), swap the position of the blank and non-blank cells. When the picture is reassembled (i.e., all 36 slices are in their proper positions, then replace the blank picture by the missing ninth piece. 

 

#6C: Poll Taker--

Create a table that fills the entire top 3/4 of the screen with 100 rectangles (measuring the screen to determine the size of the rectangles, that are placed 10 cells per each of 10 rows). Choose between 6 and 10 different colors that "go nicely together." Whenever a button (appearing in the bottom quarter of the screen) is pushed use your colors to fill the colors of the table cells at random.  Whenever a second button is clicked, generate a report which shows the total number of cells having each of the colors used. (For example, if six colors have been used, we would expect about 100/6 or 16.7 cells to end up having each of these six colors.)

Work on previous assignments:

solution3.htm

solution4.htm

solutionToANon-existantProblem.htm