This is a quick side project I built to try Firebase. I was surprised how easy it was to put something together. Their onboarding process is fantastic, the docs are well-written, and their sample apps provide several simple design patterns to use as starting points.<p>I thought that Firebase would be incredibly useful as a rapid prototyping tool, but I'm now thinking of using it as a backend for a couple of apps I'm bootstrapping and doing away with servers altogether. iOS support and other interesting features are in the pipeline, and it's already an incredibly compelling platform.<p>The only thing missing for me right now is webhook support.
Funny, my first attempt at a real-time web app was also a Deathmatch Rock Paper Scissors server. But it was 1997, so the spock version wasn't yet invented.<p>Picking a technology for the 2-way comm was tough back then, since Layers only worked on Netscape and IFrame was IE only. I ended up going with a frameset and zero-height frame at the bottom of each screen. When you input your move, it'd submit a form on the frame and update the state on the server. And the frames would periodically poll to see if the opponent had given his move.<p>Once both moves were available, it'd run its little Mortal Kombat pixel art animation and crush the opponent's scissors with its fist. It was start of the art at the time. I hadn't ever seen anybody do real time web stuff at that point.<p>As I find happens with most "build something silly while slacking off at work" scenarios, we ended up shipping it a few months later. One of our products looked like it could actually benefit from the ability to real-time update one of its components, so I tore out the fighting and used the RPS comm stuff.
"waiting for opponent..." on /?random<p>Is it down?<p>Edit: Reloading the page (with /?random) either generates a random room for me, which is no use when I want to play a random opponent, or does something in a flash and then asks me if I want to play again, meanwhile still displaying a 0-0 score. When I click play again, it keeps saying "waiting", though in the right bottom there is an opponent connected. I somehow doubt it.
I played to 37 wins with a friend to decide who buys the drinks tonight. By the end, he couldn't choose rock or scissors, and I couldn't choose lizard, and sometimes he would pick two things at a time. We decided that these are intended depths of the game, and we needed to practice more in order to learn the subtle dynamics of the game. Good Job!
The wikipedia article points out that some people have problems creating Spock's sign. Which made me think that if someone couldn't play Spock's sign, then that changes your strategy, which changes your opponents, which changes yours...<p>I need to dust off my game theory textbook.
Neat. Bug report: score is not preserved among reconnections. Example: I close my browser by mistake when we're 4 - 2, when I load the URL again scores are back at 0 - 0 (but the other player that not disconnected still has 4 - 2).
I wanted to try it out but "find random opponent" never found a random opponent.<p>If there is no "random opponent" to be found within say 20 seconds, you could fake the "random oppenent" to be a program that is random-rpsls'ing with me.<p>Nice Spock intro animation!
I wonder if this can be turned into a competitive version of Dual N-Back? "Magic" style card games could be given this treatment as well, but would have to be mediated by computer.
I've got these nephews (-in-law) that play this weird variant that has to do with guns and shields and badges and a few other things... wish I could find the rules.
Seems to randomly declare a winner without me ever choosing anything. Presents me with a choice half the time, otherwise it just declares a random winner.