this post was submitted on 19 Jun 2023
4 points (100.0% liked)
Rust Programming
8191 readers
3 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I was actually vaguely thinking that for playing cards, there's no actual way to do maths on it (like you can't add an Ace to a Jack, or a Joker to a Queen). Are Aces high? Is the 2 worth 2 points or something else? So maybe OP is better off just defining the ranks manually (A, 2, 3 ... J, Q K) and then separate out any points calculations. In that sense, OP might actually want the game rules encoded into the type system.
EDIT: Also, nice, I remember reading that story.