| |
| META TOPICPARENT |
name="CSC221SylS2026" |
|
|
< < | Objects Lab: Tic Tac Toe Game: Spring 2026 |
> > | Objects and Interfaces lab: Neurons: Spring 2026 |
| | Learning Objective(s)
- Design and develop a program using objects
- Use interfaces
|
|
< < |
- Abstract i/o into only one class
|
> > |
- Learn about neural networks
|
| | Overview of the Program |
|
< < | Write a program to allow two users to play the game of Tic Tac Toe. |
> > | Design and implement a neuron that can be used for a neural network |
| | Specifics |
|
< < |
- No code or data files are provided for this lab
- The main method should be found in a program called GameDriver
- The game should be played in text mode
- The actual game should be allowed to be created in two modes:
- Default size (3x3) that also gets the players' names
- A non default size that also gets the players' name. (The game should allow for different size boards, not just a 3x3)
- Each of the classes need (except GameDriver) needs to have an interface that defines the action for any game. For example: a BoardInterface must define the actions associated with a generic board. Then the TicTacToeBoard is to implement that interface and add additional methods associated with Tic Tac Toe if appropriate.
- Only one class can do any direct I/O and it can't have any code that knows about the game. It can only do general type I/O
- The grade will be partially based on the design of the classes
- Classes should include any "helper" methods that are appropriate (even if not used in the game). This helps in testing and debugging
|
> > |
- No code or data files are provided for this lab until after the design is turned in. Once the design is turned in, a correct interface for the neuron will be provided and must be used to create the final Neuron.java code. The code using the Neuron will have been compiled using that interface.
- The code should be Neuron
- A neuron has an array of neurons that are inputs and for which it is an input.
- The input neurons each has its own weight.
- The neuron needs to allow for training
- If the value of the computed average is less than the threshold, it should output 0.0 otherwise it should output a 1.0;
- A neuron needs to be copied to allow for a creation of a similar network.
- Classes should include any "helper" methods that are appropriate. This helps in testing and debugging
|
| | Prelab: Reading for details
- Complete the reading for detail quiz at least 24 hours ahead of time.
- If you pass with a 90% you are done.
- If you score less than 90%, you must take a hard copy of this lab and highlight where the answers are to the quiz and bring it to lab. The quiz questions will be reposted about 24 hours before the lab so you can do this task.
Phase 1
Design the program and develop a testing plan. |
|
> > |
- Create an interface for a neuron.
|
| |
- The design must include a complete UML diagram and should correctly include all major functions
|
|
> > |
- Develop a unit test for your neuron. You should be able to compile it using your interface.
|
| |
- The testing plan should included unit testing and integration testing
- Submit a Software Design Report in only one pdf
Phase 2 |
|
< < | Using your graded software design report
- implement the program first for just a 3x3 game. Try to not hard code the number 3 into your operations. Only when that works with the issue with I/O should you try to expand your code to allow for an NxN game. Everything else will be worth many more points that what can be earned by allowing for an N x N game.
- create a Software Development Report incorporating any necessary changes from the software design report. Be sure to include detailed instructions on how to run your program, including any instructions for extra credit.
|
> > | Using your graded software design report and the provided correct interface and .class files
- * create a Software Development Report incorporating any necessary changes from the software design report. Be sure to include detailed instructions on how to run your program, including any instructions for extra credit.
|
| |
-
- include statement coverage (in additional to the unit testing and integration testing) in your testing report. If you create unit test programs, for unit testing you can just refer to each section in your report (no need to list input/output, but you must describe the purpose of each group of tests.
- create a zip folder containing only the following (and submit it)
- only one file (as a pdf) with the completed software development report
|
| |
-
- any input files you might want to have the grader use when running the program
- any unit testing .java files
Optional improvements |
|
< < | Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
- Allow the user to save and reload a game
- Allow for an AI player (only when it is a 3x3 game). Because of the limited options, you should hard code the program to play a perfect game
|
> > |
- allow your neuron to return a double (any value ranging between 0 and 1) with the precision specified by the threshold. If you do this, this code needs be to call EnhancedNeuron.java and still implement the NeuronInterface.java. You should turn in both implementations of the interface.
|
| | Post lab
- Compare and contrast your solution to the posted solution.
- In your writeup, indicate anything that was different between the two and comment on that. (There will always be some differences. Your code might be better.)
|