Game package 2 (30%)

You need to extend your game package to include a custom vctrs class, and some element of metaprogramming or the use of C++.

All user-facing functions should have examples and unit tests.

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.

Ten-pin bowling:

  • Create a vctr to neatly print out frames of a game, including formatting for strikes, spares and splits.
  • Create methods for useful calculations like score, and frame_strike(), frame_spare(), frame_closed(), etc.

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.

Snakes and ladders:

  • Represent the state of the board with vctrs, and create print methods to show the state of the game.



Due: 6 June 2025
  Submit