

Show HN: Tic-tac-toe, with a multiplayer twist - mayop100
https://tic-tac-tic-tac-toe.firebaseapp.com/

======
fatty0011
Hey HN, I'm the creator of this multiplayer tic-tac-toe game called tic-tac-
tic-tac-toe. It's a Firebase-powered variant of the game everyone knows that
pits GitHub against Twitter. Let me know what you think!

~~~
Xeoncross
I would join, but it wants my email which I'm not sure why you need it since
it gives you my other github information to insure I'm not a bot.

~~~
fatty0011
Sorry to hear that. I'm not actually using the emails in any way and don't
have plans to. The reason it asks for your email is that I'm using Firebase
Simple Login which requests the email scope by default.

------
chavesn
I'm so impressed with the UI and execution. Very well done. No complaints,
except that it's perhaps the move timer is a little fast.

I first learned about Ultimate Tic Tac Toe here[1]. Might be worth a link to
that post -- it's a great explanation with surprisingly satisfying
illustrations.

[1]: [http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-
tac-t...](http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/)

~~~
fatty0011
Thanks for the comment! I considered giving each team 10 seconds per turn but
settled on 5 seconds since I didn't want the games to last too long. I wanted
to make it such that people kept saying "oh I'll just play one more game." And
- for what it's worth - I think that's the same place I first heard about the
game.

~~~
speeder
I still feel 5 seconds is too short.

I actually decided to stop playing the game rather quickly, because the team
is so desperate to move in 5 seconds that they make several terrible moves in
a row, easily losing the game in a almost minimal amount of turns possible to
lose.

------
chrisBob
The 9 game grid makes for an interesting game with two people, but the crowd
tends to rush for the wrong move. I wish there was a way to explain that you
don't need to dive on a move to block the other team as long as you don't let
them play in that sector. Unfortunately cooler heads are usually outnumbered.

~~~
ddt
This and Twitch Plays Pokemon have taught me a lot more about group efficiency
than The Mythical Man Month

------
fsk
What's the optimal strategy if you're playing solo vs solo (no team)? Regular
tic-tac-toe is an obvious P1 draw due to the strategy-stealing argument, but
that doesn't apply here because your move restricts your opponent's move
choice.

This game can't end in a draw, bc majority gets the win.

~~~
thomasahle
I recall lots of people found winning strategies when the game first came out.
They were based on always sending the opponent to the same field.

~~~
fsk
I meant optimal perfect strategy, either via a proof or a game tree search
(alpha-beta pruning). With 3^81 game states (most not attainable), it should
be searchable.

More precisely, the game has a finite # of states, and cannot end in a draw.
It's always a win for P1 or P2. If both people play perfectly, who wins and
what is the optimal strategy? (Note: It is possible that this game is a P2
win, because your move restricts your opponent's choice.) (For the person with
the guaranteed win, what strategy forces the win? For the person who can't
guaranteed win, what strategy gives your opponent the most opportunity to make
a mistake?)

~~~
gibybo
I'm not so sure that it's searchable. 3^81 is quite a lot. I don't know of any
solved game with that many. Tic-tac-toe, connect 4, checkers, etc all have
less. I think 3^81 is comparable to 9x9-Go and Chess which are both unsolved.
I suppose it depends how aggressive you can prune (which, admittedly, is
probably pretty aggressively).

~~~
fsk
To (perfectly) solve 9x9 go, you need to consider almost every move at every
turn. That's a branching factor of 40+.

In this game, there are (usually) at most 9 legal moves per turn. The
branching factor is a lot less. (Giving your opponent free choice to play
anywhere is frequently a mistake.)

------
mayop100
Team Github seems to be the far more popular choice. Though strangely, it
seems like the smaller team Twitter does better. Maybe crowds aren't as smart
in this case?

~~~
650REDHAIR
Team Twitter was going really well around the 8 person mark vs the 20 or so on
GitHub.

This was a blast. Great presentation. Who had the idea to pit GitHub vs
Twitter?

~~~
fatty0011
It was ultimately my idea to pit these two teams together in this format but I
initially got the humans vs. humans suggestion from a coworker. I initially
had it as a single human team versus a computer AI but I think this makes for
a more exciting matchup!

------
gagege
I'm currently addicted to TicTactics and know a few decent strategies, so the
experience of wanting to use a non-obvious move required for planning-ahead
but having all the other players do the obvious move, is very frustrating.

BUT, that's just me. Nice app anyway!

------
yeldarb
Nice, looks like this is also using the Firebase Hosting beta.

First time I've seen that in the wild but I've been using it in lightning
talks for a couple of months now. It's pretty slick.

------
trekker272
This is great! The mob seems to make some funky decisions. I'm curious to see
what happens when more people join; if the mob gets smarter or if they get
worse. Tell you friends and let's find out!

------
dbieber
I think the rules are implemented incorrectly. Multiple times I've seen a move
get made that seems to violate the rules.

As an example, I just saw team Twitter place a piece in the center square of
the top left board (the center board had not yet been won). The Github team
then proceeded to place their piece in the bottom right board rather than the
center board. It may have been the case that there was a split vote for center
and bottom right in Twitter's move that resulted in this bug manifesting
itself.

~~~
neil_s
I'm glad I'm not the only one who's seeing glitches. I've had instances of the
right squares being lit up in green, but then a square on another board, which
shouldn't be permissible, actually get selected.

~~~
fatty0011
I am seeing some of these issues as well. Also seeing the clock do some weird
things. I am going to reset the host in a game or two and hopefully things
will get back in sync. The game will probably be way out of sync for a few
seconds while I do the reset.

~~~
fatty0011
Things should be better now!

------
Kiro
Very cool. How do you make this with Firebase? Do you have a central server
polling the Firebase collection or how does it make the decisions if all logic
is on the clients?

~~~
fatty0011
Each client writes to a "suggestions" node in the Firebase with their
suggestion. Each client also listens for changes to that "suggestions" node to
show you how many people have voted on a particular square. Firebase
internally does all the work to send the changes on the "suggestions" node to
every client. I also have a single host computer (not a server, just my laptop
next to me), which goes through all the suggestions once the timer runs out
and makes a move for the current team. This move is written to the Firebase
and every client is notified by Firebase that the move has been made. They
each update their own UI and the process starts over.

------
brokentone
Very interesting. I half to imagine most of the crowd doesn't understand the
rules, or is intentionally trying to throw the game. Many of the moves that I
saw happening were exactly the wrong move to make.

Here are rules and strategy as discussed here prior:
[https://news.ycombinator.com/item?id=5898506](https://news.ycombinator.com/item?id=5898506)

------
lucb1e
Are there loads of trolls or do I not see in what universe it is a good
strategy to send the enemy to a block we _almost_ own?

~~~
jaynos
I think that's due to the timer causing people to make mistakes.

------
vxNsr
It's pretty fun, one complaint is that it sometimes drops moves or uses ghost
votes to put us somewhere we didn't vote for... still cool for a weekender!

------
catshirt
i sense an off-by-one error? i was the only one playing for team Github:

Team GitHub played [8,1,0] @kn0ll chose [8,2,0]

------
dwaltrip
Any thoughts about adding chat? =)

~~~
vxNsr
Yeah, because most ppl don't read the rules and don't understand how the game
works, with chat we could try n' educate 'em...

------
_zen
Collaborative gaming has a lot of promise, but so far it's been implemented
poorly.

You need to allow gamers to create small teams, and allow them to talk with
one another to discuss strategy. Then they decide on a move.

Someone make chess using the above.

~~~
chavesn
To be fair, these implementations are only poor in your opinion. And your
suggestion might be poor in other ways.

For example, I would suspect far fewer people are willing to invest upfront in
a game like yours. It's much easier to find two people who want to play chess
against each other where they are fully in control, than two groups getting
only one single, slow game out of it.

One way a more thoughtful, strategic game like yours might work would be to
achieve critical mass with a simpler, fast paced game and then add depth.

------
lechevalierd3on
Very simple UI with a small learning curve. Bravo, this is fun.

------
iLoch
Team Twitter > Team Github! :) _tribal chest pound_

------
joeframbach
Twitch plays Tic-tac-toe!

------
pantalaimon
for some reason it causes 100% CPU load after some time (Chrome 34)

