Skip to content
Menu
Timeless College
  • Alex Cavazzoni
  • Art Classes Near Me
  • AWS Training in Virginia
  • Bad Influence On Children
  • BROWZ safety compliance
  • Clarence McClendon
  • Digital Marketing Consultancy Kelowna
  • Freedom of speech on social media
  • Https://timelesscollege.xyz/
  • Https://timelesscollege.xyz/ – Timelesscollege.xyz
  • Https://www.timelesscollege.xyz/
  • Https://www.timelesscollege.xyz/ – Timelesscollege.xyz
  • In Home Tutoring
  • Integrated Atpl
  • Jewish Intimacy
  • Learn to play guitar online
  • Online Baseball Hitting Trainer
  • Prince George School
  • Quickbooks Classes
  • Sample Page
  • Schreibwettbewerb
  • STOCKS CRYPTO FOREX Trading
  • Timeless College
  • Timeless College – Timelesscollege.xyz
  • Timelesscollege.xyz/
  • Timelesscollege.xyz/ – Timelesscollege.xyz
  • Training as a Pilot
  • Website Creation Atlanta
Timeless College
Assignment requirements – My Assignment Tutor

Assignment requirements – My Assignment Tutor

November 2, 2021 by seo_automation_owner

CSE5APG-Semester 2, 2021Assignment 2Build a Naughts and Crosses game1 Assignment requirementsˆ Due: 11:55pm, 16/10/2021ˆ This is an individual assignment, and it covers 25% of the final mark forCSE5APG.ˆ Your work should be submitted by the due date online via the LMS.ˆ All submissions will be checked by TURNITIN plagiarism software . Anycopy-paste will be referred to LTU academic integrity. So please avoidcopy-paste from other or any website.ˆ You should write a piece of code for each process. Do not MANUALLYadd, delete, or make any sort of calculation.2 Assignment descriptionThe Assignment 2 will test your understanding and ability to apply whatyou have learnt throughout the lectures.ˆ Python basicsˆ Data structuresˆ Functionˆ OOPˆ Exception HandlingNaughts and Crosses game (aka Tic-Tac-Toe) is a well-known and very simple two-player game. The game consists of a playing grid (3×3 or higher) andtwo players. The playing grid has a set of squares. The squares will be filledby the players. The two players are known as the Naughts player which will be1detonated as ”O” and the Crosses player which will be denoted as ”X”. Theplaying rules are :ˆ The Naughts player plays with ”O”.ˆ The Crosses player plays with ”X”.ˆ Players take turns by placing ”O” or ”X” on the playing grid square.ˆ Only one player can play at a time- either ”O” or ”X”.ˆ The player makes their selection by entering the location of grid squarethey want to go (the square they want to fill).ˆ If any of the two players have filled a grid square, then the other playerand the same player cannot filled that square.ˆ If any player gets three of their marks (”O” or ”X”.) on the board in arow, column or one of the two diagonals, this player will be the winner.ˆ When the playing grid square fills up with neither player winning, thegame terminates with no winner.3 Steps you must completePlease see and run attached code: test.py . You need to convert test.py into anew code using: function, OOP and exception handling. The code should askthe user to key-in the size of playing grid (e.g., 3×3, 6×6, ..etc). For example,current grid and final should be printed using function. In addition, invalidinput should be handled. You need to develop three main classes: Board,Player, GameState. Each class must be implemented and tested. It is expected that your program can accept various grid sizes, so all input should beset automatically based on the gird size. You must use the same names forclasses (Board, Player, GameState) and functions.The main steps are:1. Once you run the program, the user will be prompted with a menu.2. The user will need to enter their choice.3. The choice will be to either begin the game, or quit.4. If the user enters an invalid choice, the user should be prompted appropriately letting them choose once more.5. The program should not end unless the user chooses otherwise.26. If the user begins the game, the game will be terminated if one player winthe game or all playing grid square have been filled up with neither playerwinning.3.1 Main MenuIn the main menu, the user will be prompt with a menu consisting two choices.ˆ Begin the gameˆ Quit the gameThis will menu will be printed out to the screen.Pseudo Codeprint (“introduction message”)print (“choices for the user”)3.2 User enter choiceThe user will enter their choice. Which will result in the following.ˆ Begin game should prompt with The game has begun then return tothe main menu.ˆ The quit game, should break out of the loop and stop the program.Pseudo Codeuserinput = input(“ask user to input”)3.3 Check User InputThe users choice should be checked to see if it is valid. If not then throws acustom error.Pseudo Codeif invalid input:raise InputValidError()3.4 Throw custom error if user input is invalidPlease implement a custom error. This custom error should be caught be a trycatch error.3Pseudo Codeclass InvalidInputError(Exception):pass4 Overview of flow of codePseudo Code# 1. Prompt the user with the main menuwhile True: # 2. Infinite loop until user exits.if check if user quits:# 2. if the user quits, break out of loopelif is choice valid:# execute users choice# back to main menuelse:raise InvalidError()5 Classes InformationThe Assignment 2 will consist of developing three main classes: Board,Player, GameState.NoteHelper classes can be designed to support the 3 main classes. Theseclasses will not be graded. These support classes do not have to betested.6 The MainBelow is a detailed UML diagrams explaining how the classes are related toeach other. They are for explanation purpose. You can add any parameters orfunctions.NoteThe UML diagram is a guide. If you wish to design your structure, youmay do so.46.1 Overview of class relationship ≪Main≫main BoardGameState Player7 Board7.1 Relationship Board– display board(board: list)+ check board(board: list, gameover: bool) 7.2 Board ClassPseudo Codeclass Board:def display_board(board):passdef check_board(board, gameover):pass8 Player8.1 Relationship Player– interaction(board: list)+ update board(board: list, gameover: bool) 58.2 Player ClassPseudo Codeclass Player:def __init__(self, symbol):passdef _interaction(self):passdef update_board(self, board):passdef __str__(self):pass9 GameState9.1 Relationship GameState– interaction(board: list)+ update board(board: list, gameover: bool) 9.2 GameState ClassPseudo Codeclass GameState:def __init__(self, p1, p2):passdef turn(self, board):passdef place(self, player, old_board):passdef game_loop(self, board):pass6

  • Assignment status: Already Solved By Our Experts
  • (USA, AUS, UK & CA PhD. Writers)
  • CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Similarities And Differences Between Religious Buildings
  • BM0007: Explain the market equilibrium using a diagram to illustrate the local telecommunication retail market before and after the entry of MVNOs: Singapore’s Telecommunication Wars Assignment –
  • SCO104: PM Lee Hsien Loong at the Opening of Dyson’s new global headquarters at St James Power Station: Globalisation and Technology Essay, SUSS –
  • MBA3305:Challenges of Implementing Internet of Things (IoT) in Malaysian Private Healthcare Industry, Case Study of AK Hospital: Business Research Methods Research Paper, MUST, Malaysia –
  • NS2262 : Analyze a language sample of a child which has 100 utterances You can either produce a new sample or use an old sample: LINGUISTIK III Assignment, UPM, Malaysia –

Recent Comments

  • A WordPress Commenter on Hello world!

Archives

  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021

Categories

  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2022 Timeless College | Powered by WordPress and Superb Themes!