Hi again. I'd like to see the functions low_value and high_value defined for all cards.
julia> C = 5♠
5♠
julia> value(C)
5
julia> high_value(C)
ERROR: UndefVarError: high_value not defined
Stacktrace:
[1] top-level scope
@ REPL[15]:1
julia> low_value(C)
5
For Poker, you'd want to use high_value; for solitaire, I'd use low_value. This makes PlayingCards "agnostic" about ace high vs. ace low.
My further suggestion is not to define value at all, and let the user either choose which value function to use, or else define their own function either value=low_value or value=high_value.
Let me know if you'd like me to edit PlayingCards.jl to implement, or send some code snippets you can cut/paste.
Hi again. I'd like to see the functions
low_value
andhigh_value
defined for all cards.For Poker, you'd want to use
high_value
; for solitaire, I'd uselow_value
. This makesPlayingCards
"agnostic" about ace high vs. ace low.My further suggestion is not to define
value
at all, and let the user either choose which value function to use, or else define their own function eithervalue=low_value
orvalue=high_value
.Let me know if you'd like me to edit
PlayingCards.jl
to implement, or send some code snippets you can cut/paste.Thanks, Ed