Assignment # 3 Due: Nov. 6th 11:59 PM Page 1 of 12 COMP1005A - Fall 2022 Assignment # 3 Due on Sunday, Nov 6th by 11:59 pm.Submission Guidelines: Submit a single zip file...






In this assignment, you will
use Python’s
list data structure to model a board game. You are required to write several functions to create and test this text-based game. Download the Python file called
a3_q1.py
from brightspace. You are expected to add several functions to this file to make the game work.







Assignment # 3 Due: Nov. 6th 11:59 PM Page 1 of 12 COMP1005A - Fall 2022 Assignment # 3 Due on Sunday, Nov 6th by 11:59 pm. Submission Guidelines: Submit a single zip file called A3.zip on Brightspace. Did you zip it correctly? You must always create the zip files using the built-in, default, archiving program available with your operating system. If we cannot easily open your zip file and extract the python files from them, we cannot grade your assignment. Other file formats, such as rar, 7zip, etc., will not be accepted. Windows: Highlight (select with ctrl-click) all of your files for submission. Right-click and select “Send to” and then “Compressed (zipped) folder”. Change the name of the new folder “A3.zip”. MacOS: Highlight (select with shift-click) all of your files for submission in Finder. Right-click on one of the files and select “compress N items…” where N is the number of files you have selected. Rename the “Archive.zip” file “A3.zip”. Linux: use the zip program. Did you submit the correct files? You are responsible for ensuring that you have submitted the correct file(s), and the submission is completed successfully. After submitting your A3.zip file to Brightspace, be sure that you download it and then unzip it to make sure that you submitted the correct files. This also checks that your zip file is not corrupted and can be unzipped. You can submit as many times as you wish and Brightspace will save your latest submission. I would suggest that you submit as soon as you have one question done and keep re-submitting each time you add another problem (or partial problem). We will not accept excuses like “I accidentally submitted the wrong files” or “I didn’t know that the zip file was corrupt” or “My Internet was down” or “My computer was not working” after the due date. If you are having issues with submission, contact the instructor before the due date. Assignment # 3 Due: Nov. 6th 11:59 PM Page 2 of 12 Late Policy The assignment is due on Sunday, Nov 6th, 2022 by 11:59 PM (Ottawa time). Late submissions are allowed until Monday, Nov 7th, 2022, 11 AM (Ottawa time) without any penalty. Multiple submissions are allowed and Brightspace will only keep your LAST submission. The submission link will close on Monday, Nov 7th, 2022, 11:01 AM. Here is a summary of the penalties based on the submission time. Last submission Day/Time Penalty applied Sunday, Nov 6th, 2022 by 11:59 PM (Ottawa time) No penalty Monday, Nov 7th, 2022, 11:00 AM (Ottawa time) No penalty Monday, Nov 7th, 2022, 11:01 AM or later 100% Regret Clause If you think you have committed an academic violation (plagiarism), you have 12 hours after the final allowable submission time (11 pm on Monday, Nov 7th, for this assignment) to invoke this regret clause. If you do, you will receive ZERO for the assignment (or portions of it that you invoke the clause for) but will not receive any further sanctions from the Dean’s office. Your assignment will still be used when we are checking for plagiarism, but you would not face any further sanctions if it was decided that you had committed an academic violation. For example, if you collaborated too closely with another student and this is discovered, you would not be further sanctioned. The other student, if they did not also invoke this clause, may still be further sanctioned by the Dean’s office. This is not a group project, so collaboration is not allowed on this assignment. Assignment # 3 Due: Nov. 6th 11:59 PM Page 3 of 12 Self-Evaluation Quiz Criteria SE Quiz 3 is a follow-up quiz for Assignment-3. After you submit this assignment, you will be able to take the quiz on Brightspace. You will be asked some leading questions to help you assess the problem-solving skills that you might have achieved by doing this assignment, such as: • Do you feel more comfortable with programming terminologies? • Did you draw a flowchart or write pseudocode to help understand an algorithm? • Did you try to break your problem into smaller sub-problems and solve each sub-problem separately? • Did you use examples to help understand a problem? • Could you explain the problems in your own words to someone else in this class? • Did you find similar or related statements that we've talked about in lecture or tutorial, and did you try to understand how the problems were similar and how they were different? • Did you ask a question on discord that required you to communicate what you understood and what was still confusing? • Did you answer a peer's question on discord? • Do you feel more comfortable using Python data structures like lists and dictionaries? • Do you feel more comfortable using Functions, scopes, local/global variables in Python? • Did you trace your code/algorithm and make sure it follows correctly and produce the correct results? • Did you try to identify the stages of the programming life cycle while you were solving a problem for this assignment? • Do you feel more comfortable with identifying the errors in your code and handling those properly? • For the given assignment, which letter grade would you give yourself (A+, …, F)? • In 2-3 sentences, justify your letter grade selection. Note: only the last two questions are mandatory for this quiz. javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// javascript:// Assignment # 3 Due: Nov. 6th 11:59 PM Page 4 of 12 Topics: Functions, Data Structures: Lists In this assignment, you will use Python’s list data structure to model a board game. You are required to write several functions to create and test this text-based game. Download the Python file called a3_q1.py from brightspace. You are expected to add several functions to this file to make the game work. Please be sure to read through the entire assignment before you begin to design your algorithm. There will be plenty of opportunities to apply the decomposition and pattern recognition techniques in this assignment. If you apply these techniques correctly, the complexity of this assignment will reduce significantly. Be sure to make a plan and design your algorithm before you begin to add code to the python file. You are required to present your plan/algorithm if you seek any help from the TAs or the instructor. The game – version 1: This game is a fusion of two very popular games; the tic-tac-toe (a board game) and the rummy (a card game). Tic-tac-toe is a well-known game that requires two players to enter some symbols in the cells of a board/table/two-dimensional list and match them either horizontally, vertically, or diagonally. Rummy is a card game that can also be modeled using a two-dimensional list and two or more players must match the suits and/or values of their cards to win this game. You can check these links here https://en.wikipedia.org/wiki/Tic-tac-toe and https://bicyclecards.com/how-to-play/rummy-rum/ for more information about these games. You will create a single-player game in this assignment. Read the following descriptions carefully. 1. The deck: We will use a deck of 16 cards, where each card will be simulated with a 1-D list containing a pair of values in this format [suit, value]. A suit is a string taken from this list [“RED”, “BLK”]. A value is an integer in the range [2, 9], inclusive. Examples of some valid cards are [“RED”, 5], [“BLK”, 9], [“RED”, 2], and [“BLK”, 7]. Any other combination of these values and suits outside the given ranges are invalid, for example, [“RED”, “BLK”], [“BLK”, 5, 6], [7, “RED”] and [“BLACK”, 2] are all invalid. You’ll find a function called create_deck() in a3_q1.py that creates this deck of cards. 2. The board: This game will use a 3-D list (we will call it board in this specification) of size 3 x 3 to display the cards on a player’s hand. A player’s hand always stores 9 cards. These cards will be taken from a shuffled deck. Note that ‘3 x 3’ indicates that the 3-D list (board) always has 3 rows and 3 columns. Each element on this board is a card (1-D list). See the example below. https://en.wikipedia.org/wiki/Tic-tac-toe https://bicyclecards.com/how-to-play/rummy-rum/ Assignment # 3 Due: Nov. 6th 11:59 PM Page 5 of 12 Board = [[['BLK', 6], ['RED', 7], ['BLK', 3]], [['RED', 4], ['BLK', 5], ['BLK', 4]], [['RED', 3], ['RED', 2], ['BLK', 7]]] Whenever a board will be displayed to the player it must use the following format. | BLK,6 | RED,7 | BLK,3 | | RED,4 | BLK,5 | BLK,4 | | RED,3 | RED,2 | BLK,7 | Note that the ‘|’ symbols are not part of this 3-D list but they are used to display the board on the terminal. Note that, the square brackets ‘[‘ , ‘]’ and ‘’ symbols should not be printed. 3. The objective of the game: the user will receive the first 9 cards from a randomly shuffled deck. The user wins the game if the cards on their hand match one of these two categories. Otherwise, they lose. • Category 1: Simple set (10 points): all cards on a row/column/diagonal on the board must have the same suit (can have different face values). Examples of two simple sets are [“BLK”, 8], [“BLK”, 5], [“BLK”
Nov 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here