-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refractor Card Class and the Deck Class
- Loading branch information
1 parent
cb8ad58
commit 1a0a1cc
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
class Card | ||
attr_accessor :suit, :value, :face | ||
|
||
@SUITS = ["s", "h", "c", "d"] | ||
|
||
@FACE_VALUES = {"A" => 13, "K" => 12, "Q" => 11, "J" => 10, "10" => 9, "9" => 8, | ||
"8" => 7, "7" => 6, "6" => 5, "5" => 4, "4" => 3, "3" => 2, "2" => 1} | ||
|
||
class << self | ||
attr_reader :SUITS, :FACE_VALUES | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters