Well, it is meant to be a two-player game.
Printable View
Well, it is meant to be a two-player game.
I'll let you click my mouse if you . . .
Seriously though, I think that would be more practical with pencil and paper.
Or - it could be played over a live connection. In fact, I'm fairly sure there is a way to do that already, but not with javascript.
I wonder though, how hard would it be to create the routines to make the browser compete with the user?if {} else if {} else {}. I mean - either there is a way to complete a box, or a way to not let the opponent complete one, or not a way to not let the opponent complete one. Just three basic states whenever the browser gets control. That is, unless I missed something about this game. Do you get a free turn if you complete a box?
I'll second that.
Hhahaha:D just as good as paint huh?
I don't think it's boring since it is a two player game, but it would be nice to have the option to play against a CPU. I assume that would require a lot more coding so, maybe a future project?
That's kind of like saying that it's easy to make a chess bot — either you can take a piece, you can stop your opponent taking a piece, or you can't stop your opponent taking a piece :) Such a bot would be easily beaten by repeated application of, say, the double-cross.Quote:
either there is a way to complete a box, or a way to not let the opponent complete one, or not a way to not let the opponent complete one.
The game is a lot more complex than you might think it is from first look, John.
The strategy is to draw a line while not completing the third side to any given square, in order that the opponent cannot then complete said square. More than that, it becomes a battle of wits to get the opponent to complete that third side somewhere and also to make it most valuable when it does occur. Best played, the game will result in a series of traps where a single move will open an entire path of now available boxes to be closed, and this is what makes the game complex. Coding an opponent would be cool, but it would take a lot of work to make it a strong player.
Making some sort of live one-on-one game system would be fun, but that's sorta beyond this discussion-- something I've pondered a little for a while now, with any sort of simple game. It wouldn't be particularly hard, except storing each game. It would end up having the same basic components as a chat script.
Yes, I got that. And I thought I adequately expressed having gotten that with my (above quoted) post. Apparently not. But once I knew that you get a free turn for completing a box, I saw the complexity involved. It's one thing to get a box, quite another to be forced to move again if you do.
That's just a loop, really. I don't think it's any more difficult to program the computer to play the game than it was to set up the play in the first place (after all, the same rules would apply, no?). But to make it play well, that is where things get tricky.
Ok, I have an idea but it's very insane. You can hook that up from ajax to a database to another computer with ajax and you can have a little waiting room.
In waiting room:
Sookerman [Challenge? Sookerman has beat 1 out of 3 games hes played]
djr3 [Challenge? djr3 has beat 3 out of 5 games hes played]
Nile [You have beat 1 out of 5 games you've played]
And then its from there, but thats a little harder.