Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 897 Bytes

PokerHands-deck.md

File metadata and controls

65 lines (45 loc) · 897 Bytes

build-lists: true footer: © Brian Hardy, 2017. @lyricsboy

Poker Hands

In Swift

With TDD

Brian Hardy Atlanta iOS Developers


The Poker Hands Kata

  • 52-card deck
  • 4 suits, Aces high
  • Sample hand: 2H 3D 5S 9C KD
  • Goal: Compare hands to determine a winner.

Reference: Coding Dojo


In Swift (3)

  • Protocols
    • Equatable
    • Comparable
    • Hashable
  • Enumerations
    • Associated Values

With TDD

  • Test
  • Driven
  • Design

Red, Green, Refactor

  1. Red: Write a failing test
  2. Green: Make the test pass
  3. Refactor: Improve, DRY, etc.

[.autoscale: true]

Things To Do

  1. Model Card, Suit, Rank
  2. Model Poker Hand
    • (5 cards)
  3. Identify Known Hands
    • (pair, full house, flush)
  4. Compare Hands
    • hand ranking
    • card ranking

Demo Time