Question: 1 Playing Word Games You will use Python and Visual Studio Code ( VSC ) to finish two computer programs for this assignment. Submit the

1
Playing Word Games
You will use Python and Visual Studio Code (VSC) to finish two computer programs for
this assignment. Submit the Python program script files with the solutions (file extension is py)
in Blackboard by Sunday at 11:59 PM. Programming games might be more interesting than
some of the other topics so far. In this assignment, you will create two word-based games: a oneplayer game similar to Scrabble and a game called Ghost.
Script Requirements
When writing and saving your programming files, ensure that you heed the instructions.
Specific things must be placed in the programming code for all programming coursework. The
beginning of each script file must include the assignment name, the purpose of the programming
code, the date it was written or revised, and who wrote the code. These comments can be written
as line comments or a commenting block. Figure 1 depicts an example of what this might look
like in your file. Instead of creating script files for this problem set, you will use skeleton files
explained further in these instructions. When you have completed and tested your script files,
submit the completed script files for this assignment in Blackboard.
All analysis begins with a problem to solve, a question to answer, or something to prove
(you might call this a hypothesis). The following information covers the programming
requirements and includes hints for completing this work. There are four problems that you need
to solve for this assignment.
Scrabble-Like Game Description
In this game, letters are dealt to players. Each valid word is worth points based on the
word's length and the letters used. However, unlike Scrabble, there is no game board. However,
2
unlike Scrabble, there is no game board. Several functions are provided, and some you are
required to create. Tests will need to be conducted on functions independent of the other
functions and in tandem. As a final note, ensure that your script is riddled with comments
explaining what each variable represents, what each function does and returns, and any other
personal nuances in your programming code. Proper commenting is probably the easiest points
earned in this course. When you submit this programming code, submit the final versions and the
previous revisions.
Getting Started
There are a few different files that accompany this assignment. To complete the first
game, youll work with a skeleton file, a testing file, and a word list (covering problems one
through five). The file problem_6.py is a skeleton file. Some unit testing has been created for
you in the file testing_problem_6.py. The second game is accomplished by completing the
programming in the skeleton file named problem_6_part_2.py. Youll also use the word list
"""
Assignment 6 Problem 1: Creating a one-player word game similar to
Scrabble
September 22,2022
John Smith
"""
Figure 1
Content Needed in Every Script File
Note. This contains the name of the assignment (Assignment 6 Problem 1), purpose of this
assignment (creating a one-player word game similar to Scrabble), date (September 22,
2022), and the name of the developer (John Smith).
3
for this program. While programming, all files must be saved to the same folder. When you
submit your work, dont submit the word list.
Run the Code
Open the file problem_6.py. Do not modify this file yet. Look through the code. This
code loads the words for word.txt and calls the start_game function. More tasks are
necessary to make this a game, but this code should run right now. If working correctly, you will
see the output shown in Figure 2. If it does not work, ensure all the files are in the same folder. If
it still doesnt work, ensure that you completed the steps in the first problem set under the
heading Establish the Working Directory.
Unit Testing
This assignment requires you to design several modular functions, then glue them
together to create the game. Instead of waiting until the entire game is ready, inspect what you
expect from each line of code. Test each function as you write them before coding other
functions. Unit testing is important whenever you code. There are three tests written for you to
get you started. As you progress through this assignment, run testing_problem_6.py. If
your code works as expected, this file will return a message indicating your success. Should your
code be insufficient or cause an error, a message indicating your lack of success will be
provided. The three pre-written unit test functions are test_scoring_words,
test_hand_updates, and test_word_validity. These script files will test the functions
calc_word_score, hand_update, and word_is_valid, respectively.
4
Problem One: Word Scores
This game requires scores to be calculated from the words played. You need to design a
solution to this problem using the function calc_word_score. This function should accept a
string of lowercase letters as input (a word) and the m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!