0% found this document useful (0 votes)
1K views

Python Project #1: Guess The Number

The document provides instructions for Project #2 of an Introduction to Computer Science course. Students are asked to write a "Guess the Number" game in Python where the computer picks a random number between 1-20 and the user tries to guess it within 6 attempts. The project will be graded based on implementing the full game functionality and including comments in the code. Students are to submit their Python file called "GuessTheNumber.py" via Dropbox by the due date.

Uploaded by

Matt Carlberg
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Python Project #1: Guess The Number

The document provides instructions for Project #2 of an Introduction to Computer Science course. Students are asked to write a "Guess the Number" game in Python where the computer picks a random number between 1-20 and the user tries to guess it within 6 attempts. The project will be graded based on implementing the full game functionality and including comments in the code. Students are to submit their Python file called "GuessTheNumber.py" via Dropbox by the due date.

Uploaded by

Matt Carlberg
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Computer Science SK1U Fall 2011 Instructor: Matthew Carlberg Project #2: Guess the Number Due

Date: Tentatively Wednesday, October 26 at 11:59PM. Program Specification: You will write a guess the number game in Python. In this game, the computer will think of a random number from 1 to 20, and ask you to guess the number. You only get six guesses, but the computer will tell you if each guess is too high or too low. If you guess the number within six tries, you win. Otherwise, you lose. You will write your program as a single .py file. You will write it and save it in Idles text editor. You will also use Idle to test and debug your code. The project will be graded out of 100 points, and the requirements will be as follows: 1) Program implementation grading (80 points) a. Full, working implementation of program (80 points) b. Full implementation of program, except your program keeps running until the user guesses correctly. In other words, the program does not identify whether or not you have guessed more than 6 times. (70 points) c. The program chooses a random number from 1 to 20 and asks the user to guess once. It reports whether the user guessed correctly, too high, or too low. The program does not enable the user to make multiple guesses. (60 points) d. The programmer chooses a number from 1 to 20 that is not random. The program asks the user to guess once. It reports whether the user guessed correctly, too high, or too low. The program does not enable the user to make multiple guesses. (50 points) e. Non-working code or code with syntax errors (40 points) 2) Commenting (20 points) a. Header Comments (10 points): A series of comments at the start of your Python file, specifying the author, date, and brief description of the entire program. b. Inline Comments (10 points): Extensive comments that help explain what individual lines or blocks of code do. Write your comments with the goal of helping a peer understand your code Turning in: The project will be submitted as a single file via Dropbox. In your shared folder (LastName SK1U?), upload a python file called GuessTheNumber.py

Example Game #1: Hello, I am thinking of a number between 1 and 20. Take a guess. 10 Your guess is too high. Take a guess. 2 Your guess is too low. Take a guess. 4 Good job! You guessed my number in 3 guesses! You win! Example Game #2: Hello, I am thinking of a number between 1 and 20. Take a guess. 10 Your guess is too low. Take a guess. 10 Your guess is too low. Take a guess. 10 Your guess is too low. Take a guess. 10 Your guess is too low. Take a guess. 10 Your guess is too low. Take a guess. 10 Im sorry. You did not guess my number within 6 guesses. My number was <number>. You lose!

You might also like