603
Bleeding edge tech
(lemmy.world)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Is this part of a Hi-Lo implementation for blackjack? (Also, ewww mixed types)
Yeah, just use a char for card and test
Or something, don't mix types.
The cards should just be numbers, and an enum should be used for display names
Chars are just numbers, but yeah, an enum would work fine too, sure. The only advantage with using a char for it is that there's no conversion needed for outputting them into strings so it's a little easier. Less code, very readable, etc. Though yeah, thinking about it JQKA wouldn't be numerically in the right order which could cause issues if the program did more than just implement HiLo