Coder Social home page Coder Social logo

pokerhands's Introduction

PokerHands

Categorize and compare 5-card poker hands.

card gif ##Goal: Your task for today is to classify poker hands! You have two functions to complete:

  • labelHand, which gives the name of a single hand.

##Info: Hands are 14-character strings that look like "8H TC KS 2C AD", where

  • there are exactly five cards
  • each card is separated by a space
  • each card is represented by a value followed by a suit
  • ace is "A" (remember, aces can be either low or high!)
  • king is "K"
  • queen is "Q"
  • jack is "J"
  • ten is "T"
  • all other cards are represented by their number.
  • the four suits are represented by "H", "C", "S", and "D"

Hands will be legal, with no duplicate cards.

Remember, the order of hands, from highest to lowest is

  • Royal flush: like a straight flush from Ten to Ace
  • Straight flush: 5 cards in a row of the same suit
  • Four of a kind: 4 cards of the same value
  • Full house: 3 cards of the same value and one pair.
  • Flush: 5 cards of the same suit
  • Straight: 5 cards in a row
  • Three of a kind: 3 cards of the same value
  • Two pair: you got this one.
  • Pair: this one too.
  • High card: basically, no hand.

There are no helper functions provided this time. You're on your own, but feel free to write whatever helpers you need!

pokerhands's People

Watchers

James Cloos avatar Camille Roussel 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.