Assignment 1: Python Warm-up |
CSE 415: Introduction to Artificial Intelligence The University of Washington, Seattle, Winter 2018 |
The reading for this assignment is
Python as a Second Language.
|
Due Monday, January 8
at 23:59 PM.
Update: because many students have joined the class late, we will accept solutions up to Wednesday night (January 10 at 23:59) without a lateness penalty. |
Build a Challenging Game for Humans (50 points).
Create a Python program run_Guess_My_Number that randomly selects a number between
0 and 1000, and then asks the user to figure out what the number is,
carrying on a dialog with the user until the game is over.
The user should be offered the opportunity to ask questions such
as the following:
In each turn, the user should be given the opportunity to either ask a question of the type above, guess the number directly, or quit. In the end the user's score is 0 if s/he quits, or ceiling(n/t) where n is the secret number, and t is the number of turns taken by the user to determine the number, including the correct "guess". Your program should follow these guidelines:
|
Grading
Most assignments will be
worth 100 points, but this is a short warmup assignment.
Thus, this assignment is worth only 50 points.
An autograder will be used to test parts of your program, such
as the functions isPrimeUnder1000
and is_n_minus_k_divisible_by_m(n, k, m) .
In addition we will be looking for reasonable comments in your
code. Reasonable comments here will mean having a multiline documentation
string as the first expression in a function body. This string should be
a full, grammatically correct English sentence or paragraph that describes
what the function does.
|
Turn-In Instructions
Turn in your program using the following filename using this
Google Forms page.
<YourUWNetID>_A1.py;
for example,
jnsmith321_A1.py.
|
Updates and Corrections
Turn-in instructions were added on Jan. 8 at 10:40 AM. Also, the deadline for no-penalty submission was postponed at this time (see the "update" near the top of this page). If needed, additional updates and corrections will be posted here, and/or in GoPost. |