PDA

View Full Version : cool trick to always beat Sun tic-tac-toe java applet



rifak
August 29th, 2009, 02:35 AM
hey, i was testing out java applets and i found this site on Sun's java page:

http://java.sun.com/applets/jdk/1.4/demo/applets/TicTacToe/example1.html

you play the computer against a game of tic-tac-toe. something cool and kinda funny: if you place your X in the bottom right corner, then one in the top left corner, then one in the bottom left corner, you will always win....lol nothing too smart about this applet

dragos240
August 29th, 2009, 02:37 AM
Cool!

rifak
August 29th, 2009, 02:38 AM
whoops...the title should read "cool trick to always beat Sun tic-tac-toe java applet"

jpeddicord
August 29th, 2009, 02:41 AM
whoops...the title should read "cool trick to always beat Sun tic-tac-toe java applet"

Fixed.

And yeah, I wouldn't expect an example tic-tac-toe applet to have any real AI. :P

rifak
August 29th, 2009, 02:41 AM
haha wow...im finding a bunch of ways to always beat this thing

dragos240
August 29th, 2009, 02:46 AM
Lose = yaaahoo!
Win = Yahoo :(

rifak
August 29th, 2009, 02:54 AM
oh, and java now works on the newest chromium build (the whole reason why i was testing these applets)

jpeddicord
August 29th, 2009, 03:05 AM
oh, and java now works on the newest chromium build (the whole reason why i was testing these applets)

Ah, now there's the interesting tidbit of this thread. Good to know. :)

gletob
August 29th, 2009, 04:48 AM
If you can keep your opponent out of these spaces in real life then it works too.

Chronon
August 29th, 2009, 10:35 AM
That's only possible if you play against yourself.

Bodsda
August 29th, 2009, 11:15 AM
Fixed.

And yeah, I wouldn't expect an example tic-tac-toe applet to have any real AI. :P

Real AI is not really needed for this, just a few dozen conditionals, in fact all it has to do is go in the middle first or the corner if you go in the middle. After that it is just about blocking your opponent.