Game package 2 (30%)
You need to extend your game package to include: (a) a custom vctrs class’; and (b) the use of C++. You can also consider adding some element of metaprogramming if you think it is appropriate.
- Create and document a function for creating your vector.
- Define appropriate methods for using your vector, including
format()
,vec_ptype2()
, andvec_cast()
. - Create generic function(s) for identifying/extracting useful things from your vector (examples below, e.g. suit of the card).
- Create methods for your custom generic function(s), including suitable defaults.
All user-facing functions should have examples and unit tests.
There should be at least two vignettes: one describing how to use the package (which you should have written as part of Game package 1); and one explaining the design choices you have made such as function names, arguments, user workflow, use of internal modular functions, use of non-standard evaluation if appropriate, etc.
Marks will be awarded for clean and efficient code, and for good design.
Some suggestions
Below are some ideas for how vctrs can be used with your package. We encourage you to be creative and come up with your own ideas for how object oriented programming best suits your game package.
Blackjack:
- Represent the cards with vctrs and provide functions/methods for things like
card_is_face()
,card_value()
,card_suit()
, etc.
Poker:
- Represent the cards with vctrs and provide functions/methods for things like
card_is_face()
,card_value()
,card_suit()
, etc.
AI & Generative AI tools may be used in guided ways within this assessment. If you used AI in completing this assignment, please explain how it was used, including any prompts. Where used, AI must be used responsibly, clearly documented and appropriately acknowledged (see Learn HQ). Any work submitted for a mark must:
- represent a sincere demonstration of your human efforts, skills and subject knowledge that you will be accountable for.
- adhere to the guidelines for AI use set for the assessment task.
- reflect the University’s commitment to academic integrity and ethical behaviour.
Inappropriate AI use and/or AI use without acknowledgement will be considered a breach of academic integrity.
Due: 6 June 2025
Join GitHub Classroom