this post was submitted on 18 Aug 2023
603 points (96.3% liked)

Programmer Humor

21900 readers
1807 users here now

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.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 2 years ago (5 children)

Is this part of a Hi-Lo implementation for blackjack? (Also, ewww mixed types)

[–] [email protected] 9 points 2 years ago* (last edited 2 years ago) (4 children)

Yeah, just use a char for card and test

if(card < '7') count++;
else count--;

Or something, don't mix types.

[–] [email protected] 1 points 2 years ago (1 children)

Well that won't work for 7, 8 or 9.

[–] [email protected] 2 points 2 years ago

I didn't notice that 7,8,9 had no effect on the count. My bad.

load more comments (2 replies)
load more comments (2 replies)