Malatro

About

Malatro is a simplified clone of the game Balatro. Its main purpose is to serve as an educational tool, teaching foundational programming concepts.

📢 Note: This project is purely educational and will not be used for any commercial purposes.


For Students

The remainder of this README is yours to complete. Take this opportunity to describe your contributions, the design decisions you've made, and any other information you deem necessary.

Task 1 - Partial Delivery 1

This project defines the basic entities for a card-based video game using Scala.
It includes classes for Card, Rank, Suit, Joker, Hand, and Score, each documented and independently tested.

Structure

  • cards/ → Cards, ranks, and suits
  • jokers/ → Jokers with type as a string
  • hand/ → A hand containing a set of cards and jokers
  • score/ → Score with chips and multiplier

Task 1 - Partial Delivery 2

This delivery defines the 9 poker combinations as classes implementing the PokerCombination trait.
Each class includes its name, a Score, and a verify(cards: List[Card]) method to check if a hand matches the combination.

All combinations are tested with valid and invalid cases using MUnit.
The logic uses explicit loops and avoids higher-order functions, as required.

Task 2 - Partial Delivery 3

This delivery improves encapsulation by adding explicit getters and setters to the main classes.

Changes:

  • Marked class fields as private where appropriate.
  • Added get and set methods in:
    • Joker: getJokerType, setJokerType
    • Hand: setCards, setJokers
    • Score: getChips, setChips, getMultiplier, setMultiplier
  • Updated tests to cover the new accessors.

Creative Commons License

This project is licensed under the Creative Commons Attribution 4.0 International License.


Description
No description provided
Readme 73 KiB
Languages
Scala 100%