Skip to main content
capitalization, thanks removed as per https://meta.stackexchange.com/q/2950/295232
Source Link

determine Determine image value by image name

i'mI'm making a black jackblackjack game, and i and I want to take my cards images and give each a value for the game.

i'mI'm not sure how to determine their value. should i Should I just do a big switch statement with all the images names?

orOr maybe should iI check for contains with a big if statement? likeLike if the image name contains "king", then the value is 10, or or maybe there is another way which is more efficient  ?

thanks!

determine image value by image name

i'm making a black jack game, and i want to take my cards images and give each a value for the game.

i'm not sure how to determine their value. should i just do a big switch statement with all the images names?

or maybe should i check for contains with a big if statement? like if image name contains "king" then value is 10, or maybe there is another way more efficient  ?

thanks!

Determine image value by image name

I'm making a blackjack game, and I want to take my cards images and give each a value for the game.

I'm not sure how to determine their value. Should I just do a big switch statement with all the images names?

Or maybe should I check for contains with a big if statement? Like if the image name contains "king", then the value is 10, or maybe there is another way which is more efficient?

Source Link

determine image value by image name

i'm making a black jack game, and i want to take my cards images and give each a value for the game.

i'm not sure how to determine their value. should i just do a big switch statement with all the images names?

or maybe should i check for contains with a big if statement? like if image name contains "king" then value is 10, or maybe there is another way more efficient ?

thanks!