Coder Social home page Coder Social logo

comp4004's Introduction

Assignment 1

Student:        Laura Alkhoury
Student Number: 100900969
GitHub Account: https://github.com/lauraalkhoury/COMP4004/

Features/Requirements & Test Methods:
  * determine how many players are participating in this round (which defines the valid player ids for this round)
    Suggested minimal test -- 2: Test for Minimum and maximum number of players (2 to 4)
    Class: Round
      setUp()
        - testSetUp 
        - testLowerPlayerLimit
        - testUpperPlayerLimit
        - testInitialNumHands
    Class: Deck
    Deck()
      - testNewDeck

  * input each player's hand, in the form of a player id followed by 5 cards separated by spaces, each card being identified according to the format RankSuit. 
    Suggested minimal test -- 1: Test for Duplicate cards and suites
    Suggested minimal test -- 3: Test to ensure there are 5 cards dealt to each player
    Suggested minimal test -- 6: Test for invalid cards e.g. fourteenClubs, threeShovels, thDiamonds etc.
    Suggested minimal test -- 7: Test for valid player ids
    Suggested minimal test -- 8: Ensure the order of entry is correct - e.g. player id and then the cards
    Class: Round
    addHand()
      - testAddEmptyHand
      - testAddHandWithInvalidPlayerID
      - testAddHandWithTooFewCards
      - testAddHandWithTooManyCards
      - testAddHandWithDuplicateCards
    Class: Card
    getName()
      - testNewCardName
    isInUse()
      - testIsCardInUse
    toSuit()
      - testEmptyToSuit
      - testInvalidToSuit
      - testValidToSuit
    toCardNum()
      - testEmptyToCardNum
      - testInvalidToCardNum
      - testValidToCardNum
    createFromString()
      - testEmptyCreateFromString
      - testInvalidCardNumCreateFromString
      - testInvalidSuitCreateFromString
      - testValidCreateFromString
    Class: Deck
    isValidCard()
      - testInValidCard
      - testValidCard
    isCardInUse
      - testUsedCard
      - testUnusedCard
      
  * output these hands (player id and cards) AND a rank (1 being the winner) in sorted decreasing order.
    Suggested minimal test -- 4: Hands are ranked in order !
    Suggested minimal test -- 5: Test for duplicate hands e.g. Royal Flush and ensure they are listed at the top of the ranking order
    Class: Round
    isAceToTen()
      - testIsAceToTenInOrder
      - testIsAceToTenOutOfOrder
      - testIsNotAceToTen
    countSuits()
      - testCountSuits221
      - testCountSuits5
      - testCountSuits2111
      - testCountSuits32
    countCardNums()
      - testCountCardNums41
      - testCountCardNums32
      - testCountCardNums11111
    checkStraight()
      - testCheckSortedStraight
      - testCheckUnsortedStraight
      - testCheckInvalidStraight
    rankHand()
      - testRankHandRoyalFlush
      - testRankHandStraightFlush
      - testRankHandFourOfAKind
      - testRankHandFullHouse
      - testRankHandFlush
      - testRankHandStraightAceLow
      - testRankHandStraightAceHigh
      - testRankHandThreeOfAKind
      - testRankHandTwoPair
      - testRankHandOnePair
      - testRankHandHighCard
    rank()
      - testRank
      - testTieRoyalFlushRank
      - testTieHighCardRank
    getResultsDescending()
      - testGetResultsDescending
      
Instructions:
  A demo of one Game can be observed by running the main() function in the Game class.
    You may edit the numPlayers variable (line 8 of Game.java) to represent any number of players you would like to test.
    You may also edit the addHand functions (starting from line 13 of Game.java) to add various hands of your choosing to the round.
  
  For a runthrough of all test cases, use JUnit 4 to run the test methods found in TestCard, TestDeck, and TestRound.

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.