

What I liked about mixing the colors was students get to see how ratios maintain a proportion (otherwise the color does not match). The supplies list is attached in the word document above, but it cost less than $10 and most of it can be reused by our math department. I guess I got tired of reading about paint mixture problems in textbooks and decided this would be a lot more fun (and it was). This was a fun lab involving ratios that we did over the last couple of classes. When a student’s algorithm did not sort the data they are assigned a time of Integer.MAX_VALUE to place them in last. For example if three people finished 2nd the points would be 10 for 1st, 7 for 2nd, 7 for 3rd, 7 for 4th, and 6 for fifth, … The competition checks to see if data is sorted properly (it can be either ascending or descending). In a race with 10 competitors, 1st place gets 10 points, 2nd gets 9, 3rd gets 8, … In the event of a time, everyone in the tie gets the lowest amount of that group. Once the competition is finished just click the button to indicate what the next one will be and you’re ready to go again. Then hit the usual Greenfoot “play” button and watch the competition unfold. Click on the button at the bottom to determine which algorithm will run during the competition. When you compile the project it will start running immediately. To add your students to the competition they must load their classes into the project and add a new Object from their class to the loadCompetitors() method. public static final int SIZENLGN = 100000.Depending on the speed of your computer and number of competitors you will probably want to adjust these. There are two variables to control the size of the test data generated.
#Scrolling world greenfoot source code how to
You’ll probably do your own tinkering but here’s a few hints about how to setup the competition: Get your copy here (a Greenfoot project). I’m not promising it’s perfect, but it added the dramatic effect that had everyone staying in a lunch to watch the results. I built a skeleton project that looks a little cheesy but you can see visually who’s winning as each round completes.

#Scrolling world greenfoot source code download
Students have to implement an interface ( download it here) to “plug” into the competition. The wildcard sort would be with integers so students could learn about sorting algorithms that are not comparison based (Radix, Bucket, Counting, etc.), if they wanted to (not a requirement). Students were responsible to research 2 O(n^2) and 2 O(nlgn) sorting algorithms and 1 wildcard that could be anything they like.


I was very impressed by the work the class did to prepare. Today we concluded our unit on sorting algorithms in Computing Science 12.
