Goals • Complete a project that demonstrates problem solving skills and logical thinking • Demonstrate knowledge of Python programming concepts learned throughout the semester • Choose one of the two options below
Option 1: Your Own Design Description ● You are free to design and implement a Python program of your own design. ● If you choose this option, you must discuss your idea with the professor before starting your project
Requirements ● The program must consist of at least two (2) classes (each in its own file). ● The program must consist of at least three (3) .py files. ● The program must do some kind of file reading / writing ● The program must make use of at least one (1) other Python module (e.g. tkinter, os, csv, re, PyGame…) ● The program must be well-designed as we have made in class (e.g. use a main function, have no global variables, use loops / conditionals, use functions and classes to simplify program and reuse code, use clear variable names, have comments, etc.)
Option 2: Scrabbler Description ● If you’d prefer not to design your own project, you can choose to implement a GUI- based Scrabbler – a word game helper program. The program must provide a graphical interface for taking user input (which options they want to execute, entering tiles, etc.). Your Scrabbler should read its dictionary from the [url removed, login to view] file used in a previous assignment ● You are implementing a word helper such as could be used to help play the game Scrabble. You are not implementing the game Scrabble, but if you are unfamiliar with Scrabble, here is additional information: [url removed, login to view]
ITP 115 – Programming in Python p. 2 of 4
Requirements for Scrabbler ● The program should begin with a menu of options and should continue looping until the user exits ● The program must consist of at least two (2) .py files. ● The program must consist of at least one (1) classes (in its own file). ● The program must complete at least eight (8) features from the list below ● The program must be well-designed as we have made in class (including use a main function, have no global variables, use functions and classes to simplify program and reuse code, use clear variable names, have comments, etc.) ● The program must perform error-checking (e.g. if the user chooses an invalid option from a menu, the program must display a message and ask them to enter again.
Features for Scrabbler IMPORTANT NOTE: All these outputs for these features must be determined when your program runs. You may not simply save the answers in a string and print them.
● Ask user for set of tiles and then show them the word that they can make that is worth the most points ● Ask user for set of tiles and then show all words that can be made with any of the letters ● Ask user for set of tiles and then show the anagrams (i.e. words made using all the letters) ● Ask the user for two letters, and display all the words that start with first letter but are not followed by the second letter. For example, the user could see the words start with a “Q” but are not followed by a “u”, or that start with a “T” but are not followed by a “H” ● Display all 2-letter words. ● Ask user for a letter and then show all the 3-letter words containing that given input letter ● Word verifier: Ask user for input and then verify that it exists within the Scrabble dictionary ● Ask user to enter one or more letters and then show all words that end with those letters (e.g. if the user inputs “aze,” the program would print “glaze,” “haze,” etc.) ● Ask user to enter one or more letters and then show all words that begin with those letters (e.g. if the user inputs “bri,” the program would print “brine,” “bright,” etc.) ● Ask user to enter a letter and then show all words containing the letters “X” or “Z” and the input tile. ● Whenever you display any words to the user, also display the point values of each word
ITP 115 – Programming in Python p. 3 of 4
● Display a simple table showing Scrabble point values and frequencies for all 26 letters of the English alphabet plus blanks (*the table may be save ahead of time in a string and simply displayed) ● [This one counts as 3 features.] Find all ways to play a given set of seven or fewer input tiles (the player’s rack) that extend or cross an existing word on the board (disregarding the positioning of the word on the board – i.e. don’t worry about running out of space, and don’t worry about double- or triple-letter/word scores). List the results by category (extends the word, crosses the first letter of the word, crosses the second letter, and so on). Sort each play by its total point value within each category, and display the point value next to each play.
Some recommendations for implementing Scrabbler Create a class to manage the Scrabble dictionary. Its __init__() method should read the [url removed, login to view] file into a suitable data structure maintained as an attribute of the class. Its other methods should provide various ways of querying the dictionary, as outlined above. That is, each of the features you implement should be a method in the class. The method will take some input (e.g. the letters the user typed) and then return all the words that match.
GUI Design Tips It’s a good idea to separate your data from your user interface. This is known as the model-view paradigm. The data is the “model,” and the UI is a “view” of that model. For Scrabbler, you should put your dictionary and query functions in one .py file, and your UI in a second .py file. The main entry point of the program could be in a third .py file. The benefit of this design is that you can re-use your data (your “model”) without having to bring the view along with it.
Using this approach, the Scrabbler will not never directly interact with user (e.g. it won’t read inputs from the UI or write value to text boxes). Instead, UI event handlers (i.e. methods that are called when the user clicks a button) will read input from the UI, then call methods on Scrabbler, store any output from Scrabbler methods, and write those values to the screen.
ITP 115 – Programming in Python p. 4 of 4
Deliverables and Submission Instructions • Create a folder on your computer called ITP115_project_lastname_firstname (replace # with this lab number) • Inside the folder, include your python source code • Compress the folder (make a zip file) called [url removed, login to view] (replace # with this assignment number) • Upload zip file to Blackboard site for our course
Grading (100 points) • 10 points Read Me (write-up) o Inside your project file, you must include a file called “[url removed, login to view]” o This will describe how to run your program (e.g. any required libraries with links, version of python, etc.) o You should also give detailed explanation of HOW your program works (e.g. what classes did you use, how are they accessed) o If you used any additional online resources or libraries (e.g. PyGame), you must clearly explain which resources you used and which code is your own work
• 15 points Comments and Style o Code should be formatted as we discussed in class o Variables, classes, and functions should be appropriately named o Code should be broken up into functions where appropriate o All functions should have comments describing input, output, and description o All classes should have descriptions of instance variables and methods
• 75 points Project runs and fulfills requirements o Submit your project on Blackboard