Entry #2 in the Game and Puzzle Series – Higher or Lower?
This is a card game where you reveal a card and then must predict whether the next card will be higher or lower than the first one. You will begin with $10,000 and you will need to wager on your confidence in your prediction. With 52 cards – you will have 26 matches to try to earn as much money as possible.
Think you’re the big winner? Well, talk is cheap – post your screenshots!
<—— Game and Puzzle Series
I have a test project here for anyone to test that formatting works for their region.
http://www.thirdleveltraining.com/captivate/hiLowGame/index.html
I have tried to accommodate for (comma), (decimal), and (narrow non-breaking space)
…
Works perfectly for French in this new version !… (even if I am currently in England…)
I had 3 attachments… 1 easy bet… 1 unlucky bet… And my final result !…
PS : Maybe you could add the number of cards still to play… And in the rules, you may precise that if the cards are even, it’s a lost bet !…
Anyway, it’s a big win for you to manage to make it works perfectly !…
😉
Edit : I can attach only one file !!!???… It’s my final result so… And you owe me $ 33,248,000 (in the american format !…)
…
Thanks for sharing that.
I believe this to be due to the way numbers and money are typically formatted on your computer.
In the US, we use commas and if I am not mistaken, you likely use periods.
I wanted the dollar amounts to be nicely formatted so I found a way to strip the comma and revert it from string to number, change the value, and then convert back to the nicely formatted string.  It works great on my PC/iPad but my guess is that when it encounters the different formatting rules of your PC, it breaks – something I clearly wasn’t capable of testing easily.
I will see what I can figure out and post an update.
I couldn’t think of this issue !!!…
But you must be right !…
If it could help :
When I open the game, my bet is : $ 1,000 (US way)
If I want to add 1000, it becomes : $ 2 000 (European way !!!???…)
And if I click once again to add 1000 (or other values) :Â $ NaN
I hope you’ll find an easy way to solve this !… I want to play !!!…
I had actually tried to consider this when I was still working it out.
I am using a function to specifically strip the comma and leave behind a number – so a number value can be added such as 1000
Then I use .toLocaleString(undefined) to allow the number to be formatted based on your settings. That is why you see it as European format. (Good – that part works)
Problem is when you change it a second time – there is no comma to strip out and it breaks. I was excited to have that part work on my machine and did not consider it might break elsewhere.
So I need to figure out the first part.
Does your format only have a space?
…
Hello Greg !…
I’ve tested it as you can imagine !… And liked it of course !…
But many times I got a problem with the bet value ???…
In the file attached, for example, I try to bet 5 000 $ without success ???…
No doubt you’ll find a solution and correct the project !…
😉
…
Edit : Got the same problem with the money I have ($NaN)… when I won !…
You must be logged in to post a comment.