CMPE12, Fall 2011, Section 01: Lab 2: Silly Game

Lab 2: Silly Game

 

Administrative Issues:

  • Please make sure you are attending the correct lab section. 
  • Check on My UCSC to make sure you are enrolled in a section and which one.

Tutors/TA Review:

  • Using the connector to make clean wire routing.
  • Using the signal sender and signal receiver tools to do multiple pages.
  • Demonstrate the bitmap tool and how it works by looking at the example schematic below.

 

Lab Objective:

In this second lab, you will be designing a simple Tic-Tac-Toe game.  Here are the specifications:

  • Start with the tictactoe.lgi example schematic.  You should save this file to your local folder and use it as a starting template.
  • Unzip the file xo.zip into the same directory; these are the graphics for your X and O.
  • Simulate the example design, noticing how the œ0 is displayed when you turn the selector to 2, and an X is displayed when the selector is turned to 4.
  • You may have to change the Bitmap properties and enter the file name, œXO0.bmp.
  • Create a 3x3 matrix of these and design the logic to detect œX or œO winning the game.
  • Practice good layout skills by being neat with your wiring and labeling.

This is a fairly easy game to build in logic; you are basically just ANDing and OR™ing.   The goal is to give you an idea how you can use basic logic to build simple functional units.  Also, it will give you a feeling for how much logic it takes to build things.

Lab Requirements:

You must have the following in your lab:

  • A neat and pleasing to the eye game board.
  • Logic to detect a match in any row, column, or the 2 diagonals for both the X and O player.
  • When a game is won light up an LED with a label for the winner, either X or œO.  Thus 2 LEDs at a minimum are required.
  • Use the node tool to route wires more neatly.

So, how do you win at Tic-Tac-Toe?  You simply get three in a row, a column or a diagonal.  Use the wires labeled œX or O to do this (hint: AND together three in a row).  If you get stuck you can ask the TA/Tutor for more hints. 

Extra Credit:

Detect when it is a tie and add some sounds to the system, maybe when moves are made or someone wins/ties.  Be creative.

Collaboration: You are NOT allowed to discuss this lab with other students on this lab.

 

You are required to work in pairs on this lab assignment.

Files to Submit:

  • Lab2.lgi
  • README
  • Lab Report
  • Any sound files you added

Please ask the tutor or see the class newsgroup for information on how to submit these files.

README/Code comments Requirement:

  • Please put minimal block comments at the top of your schematic including your name and UCSC email address. You should also include more information such as Due Date, Lab number (Lab2), lab title, and your section and TA/tutor.
  • Please follow the README example in the CE12C lab manual. Your README will affect your grade.
  • Please comment your schematic neatly and succinctly. Repeating comments are not necessary.

Check-off:
You should demonstrate your lab when it is finished so the TA/tutor can check you off, you will still need to electronically submit your files.

Grading template (total points possible overall: 60):

 

Doing just the lab is worth at most 50 points, with 10 points extra credit available:

A: 50-45 points.  Have a completely functional game that is neatly laid out

B: 45-40 points.  Has a game that works but is messy and poorly designed

C: 40-35 points.  Game mostly works, has some functional issues or minor glitches

D: 35-30 points.  Game is mostly done but doesn't work correctly

 

Up to 10 points for extra credit, detecting a tie for +4, and +4 for sound effects for moves or win/tie. An extra +2 is available for extra creativity in the game at the TA's / Tutor's discretion.

 

Lab write up is worth 50 points.

Happy Designing!!

Attachments