TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Real-time Rock, Paper, Scissors, Lizard, Spock

93 pointsby mayop100about 12 years ago

16 comments

modernerdabout 12 years ago
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.
评论 #5261650 未加载
jasonkesterabout 12 years ago
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.
clicksabout 12 years ago
Lovely implementation, extremely forgettable URL.<p>Can you please comment on what kind of stack you've got going on? Is this operating on websockets?
评论 #5261606 未加载
lucb1eabout 12 years ago
"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.
thelucky41about 12 years ago
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!
评论 #5261559 未加载
cheezeabout 12 years ago
Hmm, I can't copy and paste the url from the box for some reason. I can copy it, but can't paste as text...
GhotiFishabout 12 years ago
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.
JoeAcchinoabout 12 years ago
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).
评论 #5263507 未加载
justx1about 12 years ago
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!
stcredzeroabout 12 years ago
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.
评论 #5261733 未加载
tunesmithabout 12 years ago
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.
jjcmabout 12 years ago
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.
评论 #5261521 未加载
nthitzabout 12 years ago
The random function never seemed to match me with anyone.
评论 #5262213 未加载
imkevinxuabout 12 years ago
Time to duel! <a href="http://rpsls.ws#dw3nx" rel="nofollow">http://rpsls.ws#dw3nx</a>
评论 #5261458 未加载
drKarlabout 12 years ago
Bazinga!
t0about 12 years ago
Why were the two extra options added?
评论 #5261554 未加载
评论 #5261501 未加载