could you help me please?, I´m stucked with this challenge. I´ve watched the video and others possible solutions, and I would like to understand why my “idea” doesn´t works (I thought it should work…)
Please, if you have enough patient to clarfy the reassons I would be really thankfull with you.
Really appreciated for your answer jwilkins.oboe!,
I´ll try to explain what I would like to do with my code:
we start with count = 0, and we want to asign a value +1 if the cards are between 2 - 6.
That´s why I wrote if (card >= 2 || card <= 6) each value between 2 and 6 means:
2, 3, 4, 5 and 6.
Next to this, I declared that count shlud added + 1 in to count value: count ++;
Well, until this point, is it right?
inside my logic process (maybe completely wrong), if the values from cards 7, 8 and 9 are not relevant (cause count will not be anyway modified) due added value = 0, why should we declare something for they?
The other cases we need to declare are cards from 10 until ‘A’, which decrease the count - 1 each card. Well, if we declare that all values different than: 2, 3, 4, 5 and 6 should decrease the count with -1 it should works…right? at least we want to have a finally acount result diferent from 0 to return “Bet” or “Hold”.
Then I wrote else (count < 0) return count + " Hold". Here I tried to declare that each value under 0 equal “Hold”. Is should work, isn´t it?
Side note, you shouldn’t have a space between count and ++.
if (card >= 2 || card <= 6) each value between 2 and 6 means:
2, 3, 4, 5 and 6.
Your words and code don’t match. I highlighted a very important word.
Your other two if clauses have serious syntax issues. I I think it would be worth it to go back and look at the earlier if-else statement challenges because both the syntax and logic expressed in your else if and else clauses do not do what you think they do.
I´ll take again the previous if- else statements and do it again.
Related to my incongruents word and explanation, I want to reffer that 2 and 6 are included into values (from 2 until 6). Sorry if I don´t explain it correctly.