代做COMP 3023 Design Patters with C++ Assignment 1

COMP 3023 Design Patters with C++ Assignment 1 1
UniSA STEM
COMP 3023– Design Patterns with C++
Assignment 1: Werdle.
Weighting: 20%,
Due Date: See course website
Version Date Notes
1.0 14 Mar 21 Initial release
Introduction
In this individual assignment, you have been tasked by your client to create a command-line
based game called Werdle in C++. While your client says Werdle is a completely original
game that has never existed before, it bears a striking resemblance to Wordle, the webbased
word game purchased by the New York Times from software engineer Josh Wardle
for a seven-figure sum.
In Werdle, as in Wordle, players have six attempts to guess a hidden five-letter word.
Players enter their five letter word guesses into the game. After entering their guess, each
letter of the guess is marked as one of the following:
1) Not in the word,
2) In the word but in the wrong position, and
3) In the word and in the correct position.
If the player guesses the word correctly, they win.
Learning outcomes
After completing this assignment, you will have learnt to:
• Create a basic system in C++ using an object-oriented design.
• Write C++ code using modern C++ memory management.
• Write safe C++ code.
• Use C++ collections.
COMP 3023 Design Patters with C++ Assignment 1 2
Assignment and submission requirements
The assignment has the following requirements. Failing to address any of these
requirements will result in deducted marks.
1. The assignment must be submitted via LearnOnline.
2. You must submit three files: 1) a zipped GIT repository, 2) a functioning executable
(.EXE), and 3) the system design document.
3. These files must be submitted as three separate files to LearnOnline.
4. The GIT repository must:
a. Include the full GIT history;
b. Contain your Visual Studio 2022 Solution and project files.
c. The repository must be compressed using the common ZIP compression.
5. The functioning executable must:
a. Run from command line under Windows 10 or higher.
6. The system design document must:
a. Be submitted as PDF format.
b. Note: it will also exist as Word document or similar in your repository.
User interface screens
The following subsections demonstrate the expected user interface for the system. Your
user interface must match this output exactly. Further examples of output are provided in
Appendix 1.
Main Menu
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
>
The main menu shall:
• Ignore invalid input and show the main menu again.
Play a game
Here is an example of a player trying to guess the word “speed”:
guess >apple
a [p] p l |e|
guess >start
a [p] p l |e|
[s] t a r t
guess >speed
a [p] p l |e|
[s] t a r t
[s][p][e][e][d]
Outstanding!
Play a game shall:
• Create a new session.
COMP 3023 Design Patters with C++ Assignment 1 3
• Treat capital letters as lowercase letters.
• Ignore words > 5 characters and < 5characters.
• Present a letter from the word in the correct position wrapped in []. E.g. [a]
• Present a letter from the word in an incorrect position wrapped in ||. E.g. |e|
o This should consume letters. For example, if the word was “apple”, entering
“speed” would result in “ s [p]|e| e d ” — the second “e” is not
highlighted because the first “e” already consumed the single “e” in apple.
• Present the correct word if the player loses:
Correct answer: speed
• Upon winning, present a different message based on the number of guesses that
have been made:
1 guess Impossible!
2 guesses Amazing!
3 guesses Outstanding!
4 guesses Great!
5 guesses Nice one!
6 guesses You got there!
• Return to the main menu after winning or losing.
View stastistics
Played: 1 Win%: 100 Current streak: 1 Max streak: 1
GUESS DISTRIBUTION
1: 0
2: 0
3: 1
4: 0
5: 0
6: 0
The view statistics shall:
• Show the number of sessions for 1..6 guesses (the guess distribution). In the
screenshot, there was one session that had 3 guesses.
• Show the number of played sessions.
• Show the win percentage as a full number.
• Show the current win streak (i.e. the most recent number of consecutive games the
player has won).
• Shows the max streak (i.e. the longest number of consecutive games the player has
won).
• Return to the main menu.
COMP 3023 Design Patters with C++ Assignment 1 4
View help
Guess the WERDLE in six tries.
Each guess must be a five-letter word. Hit the enter button to
submit.
Examples
[A] P P L E
The letter A is in the correct position.
D |E| A L T
The letter E is in the word but in the wrong position.
The view help shall:
• Return to the main menu.
Required classes
Your assignment must design and implement at least the following classes:
Game — The Game object drives the game. Its behaviour changes depending on the state of
the game. The Game object:
• Is responsible for initialising and starting a new session (i.e. the current session).
• Is responsible for presenting the previous games statistics.
• Is responsible for presenting the game help information.
• Knows about the current session.
• Knows about all past sessions.
There should only be a single instance of Game at any one time.
Session — Represents a playthrough of the game (e.g. up to six guesses of an unknown
word). When the first session is created, it should be assigned the first word from the
dictionary. Subsequent sessions should be assigned subsequent words in-order. This is for
testing purposes. A session object:
• Knows the guesses that have been made for that session.
• Knows if any guess in the session was correct.
• Knows the final score of the session, where the score is calculated as the number of
guesses in the session.
Guess — Represents a single guess made by the player. A guess object:
• Knows the guess that was made.
• Knows if the guess was correct.
• Is responsible for presenting the guess results back to the player.
You are provided the following classes:
Dictionary — contains an array of words that you must use in your game. The system must
select words in-order from the dictionary so that session 1 selects word 1 from the
dictionary, session 2 selects word 2, etc.
COMP 3023 Design Patters with C++ Assignment 1 5
Task 1 – System design
Refer to your previous courses (e.g. OOP, Systems Design…) that have
covered UML for the skills necessary to complete this task.
This task requires you to create UML class diagram of the system to be built. Use the
description of the classes above and the domain model to inform the class diagram.
There may be more classes in the system than those described above.
1.1. Create a document to describe your system design.
• The document must include a title, your full name, email address, and
student ID.
1.2. Create a GIT repository and add your document to the repository.
1.3. Create the UML class diagram for the system.
1.4. Document any design decisions you have made as dot points (e.g. why certain
classes have certain methods).
1.5. Add a PDF of your UML class diagram to your repository.
1.6. Commit your changes to your repository.
Make sure to:
• Carefully consider the direction of the associations between classes. Only
have a class accessible by another class if it is necessary.
• Indicate multiplicity on the associations.
Task 2 – Implementation
Weeks 1–5 of the course focusses on the knowledge and skills necessary to
complete this task.
2.1. Create a new C++ console application using Visual Studio 2022 in your repository.
2.2. Add an appropriate GIT ignore file.
2.3. Add the provided source code available on the course website.
2.4. Commit your changes to GIT.
2.5. As a sanity check, clone your repository somewhere else on your computer and
ensure the entire Visual Studio solution is there as expected.
2.6. Implement the system based on the class diagram you design.
2.7. Commit your changes to GIT.
[Optional] Bonus Task – Algorithms
This task is optional for bonus marks. You can only get a maximum of 100% on the
assignment, but some students may use this task to maximise their marks.
3.1. Appropriately use modern C++ standard algorithms from to replace
manual for loops.
COMP 3023 Design Patters with C++ Assignment 1 6
This bonus task will require research. There are many algorithms in that could
be used in this system. Think about what your code is doing on your collections and search
for an algorithm to replace any manual for loops. Appropriately using lambda would also be
awarded bonus marks.
Design constraints
DC1. The required classes specified above must be implemented.
DC2. The Visual Studio 2022 solution you submit must compile and run.
DC3. C++ standard library collections must be used for storing collections of objects.
DC4. Dynamically allocated memory must be cleaned up correctly.
DC5. Collections of pointers must be cleaned up correctly.
DC6. Class member functions should be declared const unless they cannot be.
DC7. Initialiser lists must be used for constructors where initialisation is required.
DC8. The code style guide available on the course website1 must be followed with the
following exception: you can decide whether to place opening braces on the
statement line or the following line.
DC9. Your system must not use external libraries (e.g. BOOST).
Workplan
The following workplan is suggestion. First, do not wait until the due date to start the
assignment; under the “GIT” marking criteria, we are expecting to see consistent commits
each week. You can progressively build the system as your understanding of C++ develops.
Build the classes first, refactor the collections and memory management, add const
declarations. The design of C++ allows this progress refactoring of the system and is your
best approach for a successful assignment.
• If you have not played Wordle, begin by playing a game of Wordle online
(https://www.nytimes.com/games/wordle/index.html).
• You have enough information to immediately begin drawing the system design
diagram (Task 1).
• For the implementation task (Task 2):
o During Week 3, you have enough information to build the basic class
structures.
o During Week 4, you will have enough information to implement the C++
collections.
o During Week 5, you will have enough information to implement modern
memory management.
o Week 6 should then be spent testing and submission.
Constantly commit to GIT. Use it as a safety net so that you can always revert to a working
version of your project.
1 http://codetips.dpwlabs.com/style-guide
COMP 3023 Design Patters with C++ Assignment 1 7
Marking Scheme
Criteria Mark
Design (15%)
Design diagram – Marked on completeness of diagram and syntax.
Required classes are present and used correctly.
15%
Functional requirements (50%)
Main menu and View help— The main menu and view help is
present and meets the requirements.
5%
Play game — The play game state meets the requirements. 30%
Statistics — The statistics screen meets the requirements. Statistics
are calculated correctly.
15%
Non-functional requirements (35–45%)
GIT – GIT has been used. Optimal marks are rewarded for 1) at least
one commit each in Week 4, Week 5, Week 6 and 2) at least one
commit per functionality in the system. Commit messages should
use the imperative mood.
10%
Design constraints – The design constraints have been addressed in
the code implementation.
25%
[Optional] Bonus task – The bonus task has been sufficiently
addressed.
+10%
• The maximum marks achievable is 100%.
• You will be required to explain your design and code during a practical class. Not
being able to explain any of these elements can result in losing marks.
Extensions
Late submissions will not be accepted for this course unless an extension has been approved
by the course coordinator. Late submissions that have not been approved will receive a
mark of zero. Refer to the course outline for further information regarding extensions.
Academic Misconduct
This is an individual assignment. Your submitted files will be checked against other student’s
submissions, and other sources, for instances of plagiarism. Students are reminded that
they should be aware of the academic misconduct guidelines available from the University
of South Australia website.
COMP 3023 Design Patters with C++ Assignment 1 8
Deliberate academic misconduct such as plagiarism is subject to penalties. Information
about Academic integrity can be found in Section 9 of the Assessment policies and
procedures manual at: http://www.unisa.edu.au/policies/manual/
COMP 3023 Design Patters with C++ Assignment 1 9
Appendix 1 — Example output
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
> 3
Guess the WERDLE in six tries.
Each guess must be a five-letter word. Hit the enter button to submit.
Examples
[A] P P L E
The letter A is in the correct position.
D |E| A L T
The letter E is in the word but in the wrong position.
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
> 1
guess >apple
a [p] p l |e|
guess >spams
a [p] p l |e|
[s][p] a m s
guess >spelt
a [p] p l |e|
[s][p] a m s
[s][p][e] l t
guess >speed
a [p] p l |e|
[s][p] a m s
[s][p][e] l t
[s][p][e][e][d]
Great!
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
> 2
Played: 1 Win%: 100 Current streak: 1 Max streak: 1
GUESS DISTRIBUTION
1: 0
2: 0
3: 0
4: 1
5: 0
6: 0
COMP 3023 Design Patters with C++ Assignment 1 10
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
> 1
guess >spelt
s p e l t
guess >svelt
s p e l t
s v e l t
guess >times
s p e l t
s v e l t
t i m e s
guess >dealt
s p e l t
s v e l t
t i m e s
|d| e a l t
guess >dream
s p e l t
s v e l t
t i m e s
|d| e a l t
|d|[r] e a m
guess >dregs
s p e l t
s v e l t
t i m e s
|d| e a l t
|d|[r] e a m
|d|[r] e g s
Correct answer: crowd
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
> 2
Played: 2 Win%: 50 Current streak: 0 Max streak: 1
GUESS DISTRIBUTION
1: 0
2: 0
3: 0
4: 1
5: 0
6: 0
Welcome to Werdle.
Select an option :
1. Play a game.
2. View statistic.
3. View help.
>

热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图