写作CSC1002程序设计、Python语言

” 写作CSC1002程序设计、Python语言CSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamSliding Puzzle 2021..OVERVIEWIn this assignment, you are going to Design and develop an interactive sliding puzzle game where userscan choose any dimensions up to 10×10, minimum dimension is 3×3. For a 3×3 puzzle, it has a squareframedboard consisting of 8 square tiles, numbered 1 to 8, initially placed in random order as shown inthe following figure.3×3 puzzleA 4×4 puzzle has 15 numbered square tiles, from 1 to 15, as shown below.4×4 puzzleCSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamThe board has an empty space where an adjacent tile can be slid to. The objective of the game is to rearrangethe tiles into a sequential order by their numbers (left to right, top to bottom) by repeatedlymaking sliding moves (left, right, up or down). The following figure shows an example of an 3×3 puzzlewhere INITIAL is the starting point of the game, and the player needs to repeatedly slide an adjacenttile, one at a time, to the currently unoccupied space (the empty space) until all numbers appearsequentially, ordered from left to right, top to bottom, shown as FINAL.INITIAL FINALSCOPE1. At the start of the game, display a brief introduction about the game.2. Prompt user for the desired dimension of the puzzle, minimum 3, up to and including 10.3. Prompt user to enter the 4 letters used for the left, right, up and down moves. User is free topick any four letters such as j, k, r, f for left, right, up and down respectively.4. After the last prompt, generate a randomized, SOLVABLE puzzle accordingly; have it displayedon the screen using simple ASCII characters.5. Game begins by repeatedly prompting the player the sliding direction (left, right, up or down) -the direction that the adjacent tile to be moved (not the empty location). In the prompt thevalid sliding move(s) are shown together with the designated letter (from step 2 above). Forexample:a. Enter your move (left-j, right-k) 6. After each move, show the updated puzzle on the screen and prompt further direction ifneeded.7. Inform user when the puzzle is Solved (i.e. the numbered tiles are in sequential order, left toright, top to bottom); then prompt user to continue another game or end the program.8. Track total number of moves made for each game and have it displayed as the puzzle is solved.9. Validate all inputs.NOTE: Keep your entire source code in ONE SINGLE file. Use only standard python modules In your design stick ONLY to functions, in other words, no class objects of your own.CSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamSTARTUP OPTIONSNot applicableSKILLSIn this assignment, you will be trained on the use of the followings: Use input() to prompt user for information Use standard objects (strings, numbers lists) Control statements to interact With users Variable Scope String formatting (method style) Functions (with parameters and return) for program structure and decompositionDELIVERABLES1. Design documentation (A1_School_StudentID_Design.doc/pdf)2. Program source code (A1_School_StudentID_Source.py)where School is SSE, SME, HSS, FE or LHS and StudentID is your 9-digit student ID.Zip all files above in a single file (A1_School_StudentID.zip) and submit the zip file by due date to thecorresponding assignment folder under Assignment (submission)For instances, a SME student with student ID 119010001: A1_SME_119010001.zip:o A1_SME_119010001_Design.doc/pdfo A1_SME_119010001_Source.py5% will be deducted if any files are incorrectly named!!!For the design document kindly refer to section Design Documentation for details.CSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamDESIGN DOCUMENTATIONFor the design document Provide write-up for the following sections:1. Designa. Overviewb. Data Modeli. describe core data objects called Data Model (such as list, string, dictionary andso on) that you used to develop your program for representing the puzzle andtracking the sliding position.c. Program Structure (your thoughts and overall approach)i. describe the breakdown of your logic into various functions and how thesefunctions are organized (basically the structure of your program)d. Processing Logici. Describe the main processing logic.ii. Describe your technique you developed to generate the randomized puzzle.2. Function Specificationa. Describe usage of all your own defined functions, including details of parameter(s) andoutput if any.3. Outputa. Show samples of output from your programNote: See Appendix for a template of design doc.TIPS HINTS Beware of variable scope as you might keep a few variables as global such as puzzle Refer to python website for program styles and naming convention (PEP 8) Validate all inputs – if incorrect input is Detected then display a friendly response and promptthe input again.CSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamSAMPLE OUTPUTWelcome to Kinleys puzzle game, ..Enter the desired dimension of the puzzle 3Enter the four letters used for left, right, up and down directions l r u d1 34 2 57 8 6Enter your move (left-l, up-u) l1 34 2 57 8 6Enter your move (left-l, right-r, up-u) u1 2 34 57 8 6Enter your move (left-l, right-r, up-u, down-d) l1 2 34 57 8 6Enter your move (right-r, up-u, down-d) u1 2 34 5 67 8Congratulations! You solved the puzzle in 4 moves!Enter n to start a new Game or enter q to end the game n8 1 34 27 6 5Enter your move (left-l, right-r, up-u, down-d) …CSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamMARKING CRITERIA Coding Styles overall program structure including layout, comments, white spaces, namingconvention, variables, indentation, functions with appropriate parameters and return. Design Documentation Program Correctness whether or not the program works 100% as per Scope. User Interaction how informative and accurate information is exchanged between yourprogram and the player. Readability counts programs that are well structured and easy-to-follow using functions tobreakdown complex problems into smaller cleaner generalized functions are preferred over afunction embracing a complex logic with nested conditions and sub-functions! In other words, adesign with clean architecture with High readability is the predilection for the course objectivesover efficiency. KISS approach Keep It Simple and Straightforward. Balance approach you are not required to come up with a very optimized solution. However,take a balance between readability and efficiency with good use of program constructs.ITEMS PERCENTAGE REMARKSDESIGN DOC 10%-15%CODING STYLES 20%-25% 0% IF PROGRAM DOESNT RUNUSER INTERFACE 15%-20% 0% IF PROGRAM DOESNT RUNFUNCTIONALITY 40% REFER TO SCOPEDUE DATEMarch 21st, 2021, 11:59:59PMCSC1002 Computational LaboratoryCSC1002 2021 Winter By Kinley LamAPPENDIX – TEMPLATEDesign DocOVERVIEW Write one or two paragraphs to describe in high-level what your program does.DATA MODEL Describe the type(s) of data that you used to model your core objects in your program. In thiscase, it will be the game puzzle as well as the direction keys, plus any other objects that youthink of essential to mention.PROGRAM STRUCTURE Describe the structure of your program, specifically how you organized your thoughts in termsof functions and how these functions are organized. In general, you might breakdown your logicinto many functions organized by functional components, each of which performs specific role.For an example, you might have one component to create the initial puzzle, one component tohandle the update of the data model for the puzzle, one component to display the puzzle, onecomponent to handle the interaction with the users and so on. For each component, describe the role and list out the function(s) in high level, details to beincluded in section Functional Specifications.PROCESSING LOGIC (SPECIFIC) Main processing logic – describe how you Piece together various components and data model toimplement your program. Initial Puzzle – describe the technique used to generate the initial, randomized puzzle.FUNCTIONAL SPEC Describe usage of all of your own defined functions including an overview description, detaileddescription of parameters, as well as Output if any.SAMPLE OUTPUT Include a few samples of outputs from your program.请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导