Git Product home page Git Product logo

tcg's Introduction

Trading Card Game

Prerequisite

  • Java 8++ (JDK8++)
  • Maven 2+
  • Your heart

This project use JUnit5, Mockito for do Unit test and use Jacoco for test coverage.

How to test

mvn test

How to build

mvn package
java -jar {your package location}

Problem Description

Preparation

  • Each player starts the game with 30 Health and 0 Mana slots
  • Each player starts with a deck of 20 Damage cards with the following Mana costs: 0,0,1,1,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,8
  • From the deck each player receives 3 random cards has his initial hand

Gameplay

  • The active player receives 1 Mana slot up to a maximum of 10 total slots
  • The active player’s empty Mana slots are refilled
  • The active player draws a random card from his deck
  • The active player can play as many cards as he can afford. Any played card empties Mana slots and deals immediate damage to the opponent player equal to its Mana cost.
  • If the opponent player’s Health drops to or below zero the active player wins the game
  • If the active player can’t (by either having no cards left in his hand or lacking sufficient Mana to pay for any hand card) or simply doesn’t want to play another card, the opponent player becomes active

Special Rules

  • Bleeding Out: If a player’s card deck is empty before the game is over he receives 1 damage instead of drawing a card when it’s his turn.
  • Overload: If a player draws a card that lets his hand size become >5 that card is discarded instead of being put into his hand.
  • Dud Card: The 0 Mana cards can be played for free but don’t do any damage either. They are just annoyingly taking up space in your hand.

Clues

When approached iteratively with TDD you can take different starting points, like the player state or the game loop. It is your own choice whether you implement the game for human or computer players - or both. Game visualization can be anything between System.out and a GUI. You can also increase the difficulty by adding more rules, like Healing cards, Damage independent from Mana cost or introducing individual Deck building. You will find some examples of Advanced Variations from the Kata’s author at https://github.com/bkimminich/kata-tcg . Even without extra rules the toughest part of this Kata might be coming up with actually smart CPU player decision-making algorithms.

tcg's People

Contributors

iamgique avatar sakulmontha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.