Download presentation
Presentation is loading. Please wait.
Published byAustin Ryan Modified over 9 years ago
1
C OMPUTER S CIENCE G EMS 5 Challenging Projects
2
P ROJECT 1: M ASTERMIND Summary: A code breaking game 12 guesses Feedback is # correct and # correct but out of place. Can be very challenging to decide on the best strategy.
3
P ROJECT 1: M ASTERMIND Programming Techniques: Generate a 2D array that represents every possible solution to the set. Generate a 1D array that represents whether or not each parallel solution (from the solution set array) is still viable. The computer makes a random guess from the remaining viable solutions.
4
P ROJECT 1: M ASTERMIND Programming Techniques: A method returns the number of correct items in the guess. Another method returns the number of sort-of correct items in the guess. Another method updates the viable solution set array.
5
P ROJECT 2: E XPLORING E VOLUTION W ITH S TRINGS Summary: This project creates an evolutionary model using a string array. Done in two parts. Students can see how evolutionary processes can result in complex systems.
6
P ROJECT 2: E XPLORING E VOLUTION W ITH S TRINGS Programming Techniques: Download a copyright free e-book from Project Gutenberg (https://www.gutenberg.org/).https://www.gutenberg.org/ Save the e-book into a file. Read the file and store it in a single array.
7
P ROJECT 2: E XPLORING E VOLUTION W ITH S TRINGS Programming Techniques: PART 1: Generate another string of random characters Check to see if the new generation matches the target (optimal) string. If the two strings don’t match, repeat. Discussion about whether or not this would work to achieve a good solution.
8
P ROJECT 2: E XPLORING E VOLUTION W ITH S TRINGS Programming Techniques: PART 2: Generate another string of random characters Check to see if the new generation matches the target (optimal) string. If the two strings don’t match, create a new generation. The new generation only changes characters that don’t match. (i.e. the traits that are most suited to the environment are preserved). Repeat until a match is found. Discussion about whether or not this would work to achieve a good solution. What’s the difference?
9
P ROJECT 3: F LOOD F ILL AND T HE K NIGHT ’ S T OUR Summary: Essentially the same recursive strategy. A flexible assignment that can be made easier or harder depending on the class.
10
P ROJECT 3: F LOOD F ILL AND T HE K NIGHT ’ S T OUR Programming Techniques: Start by modelling a cell as an object that contains state data. (either a colour or occupied/unoccupied) Arrange the cells into a grid / chessboard using a linked grid. Choose a starting point and then use a brute force recursive method to populate adjacent cells.
11
P ROJECT 3: F LOOD F ILL AND T HE K NIGHT ’ S T OUR Use a 2D array instead of a linked grid. Can make the grid smaller. Link the grid according to the knight’s movement. Link the grid diagonally as well. EasierHarder
12
P ROJECT 3: F LOOD F ILL AND T HE K NIGHT ’ S T OUR Shows the benefits of recursion (Not easily solved using iteration). Uses a lot of different skills (methods, OOP, recursion, etc). Allows the students to ask good questions about optimization (i.e. is it worth it to look for dead ends in the Knight’s Tour?)
13
P ROJECT 4: S UDOKU S OLVER Summary: Model the Sudoku board Have the computer use logic to solve the puzzle. When logic fails, guessing can save the day.
14
P ROJECT 4: S UDOKU S OLVER Programming Techniques: Start by modelling a cell as an object that contains state data for each cell. (Potential numbers, solved/unsolved, existing number). Arrange the cells into a linked grid. When a cell gets solved, the board immediately changes the cell potentials in that cell’s row, column, and box. Look for a cell with either 1 or 0 potentials.
15
P ROJECT 4: S UDOKU S OLVER Programming Techniques: Can use logic to solve additional cells. When logic fails, can make a guess and record that guess onto a stack. If the guess doesn’t work out, the program can revert back to the last saved state on the stack. Needs to be able to detect when the puzzle has been stuck! Uses almost every skill learned in CS 20 and CS30.
16
P ROJECT 4: S UDOKU S OLVER Use a 2D array instead of a linked grid. Can use easier Sudoku puzzles. No guessing, just logic Using advanced logic before resorting to guessing. EasierHarder
17
P ROJECT 5: R ASPBERRY P I G AMEBOY Available at Adafruit.com (https://learn.adafruit.com/pigrrl-raspberry-pi- gameboy/overview)https://learn.adafruit.com/pigrrl-raspberry-pi- gameboy/overview
18
P ROJECT 5: R ASPBERRY P I G AMEBOY Summary: 3D print Gameboy cases. Spend some time decorating/customizing the cases. Assemble, solder, construct the internal parts of the machine. Work with the linux OS to align the screen and image the SD card. Install a sample game *(copyright free) Time frame: 2 weeks.
19
P ROS AND C ONS Pros: Generates hype and excitement. Get to use learned skills. Learn new hardware skills. Encourages diversification to other areas. Can be done in grade 11-12 Cons: Expensive (approx. $150 per student) Need special facilities (paint area, solder stations, etc.) A lot of work for the teacher. P ROJECT 5: R ASPBERRY P I G AMEBOY
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.