Keyboard Milestone & A New WidgetJun 11, 2009
I don't really have any more big plans for the script, but I will continue to keep updating it and adding more keyboards as they are offered to me. I'm very happy so many people have found it useful, even if that use is not what I originally designed the script for. I got a lot of linking from various tech sites a few months ago which presented the script as a defense against keyloggers. However, I still maintain that its most useful features are a) the ability to use a "keyboard" even if only a mouse is hooked up to the computer, and b) the ability to easily key special characters into forms.
Thanks to everyone for your support!
In other news, after a two and a half year hiatus from the widget arena, I decided to throw my hat into the ring once more. This time around, I built a colourful video poker widget that plays like the real thing, except not for real money
Hrms... things that I learned from this. It seems everytime I build a widget (or some tight and complex app), I end up running into some quirk of the HTML or DOM specifications which I turn to TarquinWJ to explain to me This time it was generated content (::before and ::after) on
<img> elements. Apparently, the specifications expressly forbid generated content on "replaced" elements like
<img> because the browser treats them differently than normal block-level elements. However, Opera supports generated content on
<img> elements (for now) which is why I was confused when I set up the widget as a webpage and found that it didn't work in Firefox and Chrome. I didn't know why either, other than drawing the conclusion that Opera was awesome and Firefox and Chrome were so much compiled junk
Not so! TarquinWJ informed me. Actually both Firefox and Chrome get it right, and Opera could be accused of jumping the gun on implementing a feature that was eventually decided against. Anyway, I was fooled, and ended up scrapping the generated content and doing things another way in version 1.1 of the widget.
Another thing I learned was that the rules governing which cards are the best to hold to maximize your expected return in video poker are very complex. In some cases, the cards you throw away might have a large enough effect on the weighted return, that it may make sense to keep them instead. For example, in Deuces Wild, if your intial poker hand consists of three wild cards and a pair, you should keep the pair only if they are 10 or higher.
Huh? At first, this seems odd because you don't get any special bonus in Deuces Wild for a Five of a Kind 10 or higher. Five of a Kind threes pays the same as Five of a Kind kings; so why keep a high Five of a Kind, but discard a low one? The answer lies in the cards you would have to throw away.
The highest hand you can get with three wild cards in Deuces Wild is a Wild Royal Flush, and to get one, you need two suited cards, 10 or higher. If you discard a pair of 10s or higher in order to try for such a hand, those cards are no longer in the pool of cards from which new cards will be selected to replace the discard. Because both cards were potentially part of a Wild Royal Flush themselves this lowers the chance of getting a Wild Royal Flush by just enough that it is better strategy, in the long run, to keep the Five of a Kind. On the other hand, if the pair you have is 9 or lower, discarding them does not reduce your chances of getting a Wild Royal Flush, so it makes sense, over the long run, to discard that pair and try for a better hand. Kudos to whoever calculated the odds on that one, because my brain is hurting already!
Not surprisingly, the rules get even more complex than that, and the absolute optimum strategy was just too complex to implement without extending development time threefold or more So I ended up using the intermediate strategies for each game as offered on The Wizard of Odds website. Before you consider this a travesty, note that the difference in expected return between the intermediate and optimum strategies are a few hundredths of a percent at most!
Anyway, I hope you like the new widget! I had a lot of fun building it and, have to admit, got a little bit addicted to playing it while I should have been developing it, so it took a little longer to release than I expected
Now it's on to bigger and better things! In particular...