CS 1020 - Homework 7 - Ping-pong-ball sorter and web pages

Due: Monday, 1/21

  1. Ball Sorter

    The second part of this week's assignment is to build an improved ping-pong-ball sorter that adheres to the following specifications:

    1. Your device should accept 7 ping-pong balls, some of which will be white and some black.
    2. Once started, your machine should wait for 3 seconds, then start releasing one ball at a time, and determine each ball's color as it rolls by a sensor (as in the previous homework). The color may not be sensed when the ball is resting in front of a sensor. There is no restriction on how fast the balls are released, as long as your machine can keep up with them and accurately determine the colors.
    3. As in the previous homework, your device should sort the balls into two boxes. This time, however, the boxes are supplied by us, and your machine must shoot the balls over their rims. Only the balls may rise over the rims, but not your machine (or any part thereof, at any time). The exact restriction on the dimensions are as follows:
      • Your machine (including the handy board) must at all times fit within an (imaginary) box that has a footprint of 12" x 12" and is 9.5" high;
      • the two (real) boxes for the white and black ping-pong balls have a footprint of 9.5" x 12" and are 9.5" high;
      • the boxes for the balls are positioned directly adjacent to the square area reserved for your machine (so that the entire footprint is 31" x 12").
      This setup can be observed in the front of the lab.
    4. You may only use one regular motor to shoot the balls. You may use another motor (any kind) to release the balls.
    5. Your machine must be entirely built from Legos. For example, you may not use a "foundation" of books to raise it up, and you may not build any parts from cardboard, wire, etc.
    6. After your machine has sorted the seven balls, it should stop, beep, and print the number of white and black balls, as well as the total time taken (not counting the initial pause of three seconds). The time should be reported in seconds with one decimal place. Sample output:
            white: 2  black: 5
            time: 23.2 s
      

    At the beginning of Monday's lab we will have a contest to test your devices. Each sorter will be run three times with a random sequence of 7 balls. A score will be assigned based on the number of balls sorted correctly, the speed of the sorting, and whether all specifications and rules are met.

    Notes:

  2. Web pages
    Create a simple web page for yourself. It should contain at least Feel free to get more creative! If you already have a homepage, please add a link to our course page (of course you can remove it once the course is over).

  3. Read pages 71-80 of the course pack and start collecting ideas for the final project!

  4. Email me your final project group preferences by Sunday at 8 pm the latest.

  5. Review pages 1-39 and your notes on HTML in preparation for the quiz on Monday. Also go over the sample code we presented in class as well as the solutions to quiz 2 and the programming labs.
Hand in your code for the ball sorter (one per group), and a printout of your webpage (one per person).