Skip to main content

Tic-Tac-Toe using Magic Square technique


Tic-Tac-Toe is an easy game to play. There are 19,683 possible board layouts (39), and 362,880 (i.e. 9!) possible games. This square shown below is a magic square for Tic-Tac-Toe game because all the rows, columns and diagonals sum to 15.


tic-tac-toe

WINNING CONDITION:

If the total of all the entries in one row gets to 15, player is declared winner.


POSSIBLE WIN:
Compute the difference between 15 and two squares of a pair. If its not positive or if it is greater than 9, then these squares can be ignored. Otherwise, if the difference is equal to the remaining square of that row then the next move there will produce a win.


Comments

Popular posts from this blog

Facebook Login In PHP

As we all know Time is Money. When there's a long form on your site for registration you could sometimes lose your visitors. To make this registration step a success, adding a small social login button to your site may cut down lot of burden on visitors side and will help you in getting more attention on your data rather than wasting time on the lengthy registration process. By doing so visitor will be glad to see that you care for their precious time.   What do you think will there be anyone in this small world who is not having a Facebook account? According to recent stats 1 in every 13 person in this world is using facebook.

USB Boot Procedure

Simple step-by-step solution to create a bootable usb in cmd: 1)   Take a pen drive of more than 4gb . 2)   Now the most important step is to open cmd from start->search program and files->type cmd . 3)   Now in the new window, type diskpart and hit enter. 4)   Type the command list disk . Now, note the disk which have size identical to that of your pen drive. eg. disk 1. 5)   Type the command select disk 1 . 6)   Then type clean and hit enter. 7)   Just type create partition primary and press enter. 8)  Then run the command list partition . 9)  Type select partition 1 and hit enter. 10) Format it using the command format fs=ntfs . 11) Type the commands active , assign and exit in sequence. Now just copy all the files from Boot-able disc of  windows 7 to the pen drive and your pen drive is ready to be used as a boot-able device.