(30 points)

Create a JavaScript program that generates programmatically a color test pattern that looks like this. Provide the user with a form to choose the number of blocks wide and tall the test pattern should be.

This assignment does not require much code, but you will need to do some creative thinking about how you want to tackle this.

Requirements:

  1. Every time you visit the page (or submit the form), a new color pattern should be generated.
  2. Your code should validate the form data. Don't let malformed input crash your code!
  3. Your code should be able to generate any color (excluding transparency) that the browser can display.
  4. Use functions where appropriate in your JavaScript code.
  5. Your JavaScript should be neat, clean, and commented.
  6. Style your assignment using Bootstrap. Make your site non-responsive. (There is an official Bootstrap example describing how this is done. Cite this example if you use it.)
  7. Submit supporting files as described below. In the readme file for this assignment, you will be asked to answer a few questions.

Grading

What to submit

In addition to the files required by the parts above (at least 1 HTML file and supporting resources), submit a text file named references.txt. In this file, provide a citation for each resource you used (excluding class notes, and assigned readings) to complete the assignment. For example, if you found a Stack Overflow answer helpful, provide a link to it. Additionally, provide a brief description of how the resource helped you. Your file should look something akin to:

uvaid: mst3k

http://www.w3schools.com/bootstrap/bootstrap_ref_comp_glyphs.asp
Helped me to use a glyphicon correctly.

Also provide a readme.txt file that includes your UVA computing ID and directions identifying which files are associated with each part of the assignment. Additionally respond to the following prompts:

  1. Approximately how long did this assignment take you? Was there a particular aspect of this assignment you found challenging?
  2. Describe your approach to generating the color test pattern.
  3. How are you validating form input?

Your readme should have a format similar to:

uvaid: mst3k

Homework 2

color_test.html -> this is the main file

color_gen.js -> JavaScript code for main file

Answers to questions

Make a zip archive named with your UVA computing ID and "hw2" that includes all of the required files (zip -r [zipfile.zip] [directory_to_zip]). Upload this to the submission website.

Remember, you may upload your submission multiple times. Try this before the deadline so that there is time to recover from any technical difficulties.