CSCI 261 - Programming Concepts (C++)Fall 2017 - Lab 3DQuick Links: Canvas | CS @ Mines | Cloud9 | Piazza | zyBooks |
|
| Home | Contact | Syllabus | Assignments | Schedule | Resources | | |
This lab is due by Tuesday, September 26, 2017 11:59 PM .
Yahtzee!For this lab, we are going to collectively implement most of a Yahtzee game. Everyone will make a small piece of
the game and we could then put all the pieces together to make a fully functioning game.
The first step to make Yahtzee is to know how to play. Here are the
official rules. With a partner,
get a bag of dice and play a game. Use this online score sheet
to keep score while you are playing. Be sure to take note of two pieces of information each round:
After you've played at least one complete game, take a look at the bag the dice
came in. You should see a scoring category written on the outside. You will need to write two functions for
this category.
For example, the two functions for the Full House category would be
structured as follows:
bool isFullHouse( int die1, int die2, int die3, int die4, int die5 ) {
// code goes here } int scoreFullHouse( int die1, int die2, int die3, int die4, int die5 ) { // code goes here } To test that our functions are correct and can handle a variety of scenarios, we are going to use the
AutoGrader to test our functions. Note you must be connected to the Mines
network in order to access the AutoGrader website (this means you need to
use the VPN if off campus).
Once logged in, choose "CSCI 261 Programming Concepts" and this lab. You will now see a list of all the functions possible for this lab. Begin by selecting your isXYZ() function. You'll now see a brief problem statement along the left and an editor on the right. Go ahead and click the "Test" button on the bottom left. You'll see a bar appear saying "Running Tests" and then the bar will turn red with a green box. Each of these boxes represent a different test case. By hovering over a single box, you can see the input provided for that test and what the expected output is. Hover over the green box and you'll see:
Passed Test
Input: { 1, 1, 1, 2, 2 } Output: 1 Now go one box to the right and hover over the red box. This time you'll see:
Failed Test
Input: { 2, 1, 4, 5, 1 } Expected Output: 0 Your Output: true Your goal is get all the boxes to be green. Use the editor to complete the function body. When you
make an edit, click "Test" again to see if any additional tests have passed. Two very important pieces of information:
When all the tests pass for the score function and you've submitted both functions, then you are done with this lab! Read below about how to properly receive credit for this lab. Lab Submission
Back in Cloud9 land, create a main.cpp for Lab3D. Inside this main, copy your two functions from the AutoGrader and paste them into this file. We
do not need a main() function for this lab. Also be sure that you have submitted your functions to the AutoGrader with all tests successfully passing.
You will submit your solution to this lab with the rest of A3. Detailed instructions for doing this are posted in Assignment 3. This lab is due by Tuesday, September 26, 2017 11:59 PM . | |
Last Updated: 09/19/17 10:52
|