jakeis.com = doing things @ Jake Jilg's personal home page = jakeis.com
Tools
(aesthetic only)

jakeis.com = Jake Jilg, doing things....

Jake Jilg
Tic Tac Toe Buddy!

Another game I wrote within a few hours public computer Notepad and could probably be improved.

I don't know why, but you CAN outwit the O computer and win. There's a brain fart in my logic.

But that makes it fun!

https://jakeis.com/webapp/games/tictactoe.html
Play in link ^ or in frame v.

How to logic Tic Tac Toe. Tutorial.

Imagine an array with three values for each row and those are arrays with 3 values for spaces. 0-1-2 and 0-1-2...

The easiest way to check for x's and o's is with an array of booleans with every angle of that board.

It is the layman's logarithm because it's manual check, check, check...
check 1,2 and 0,2 and so forth...

It looks like this... var board = [
            [
1,  1,  1],
            [
1,  1,  1],
            [
1,  1,  1]
    ];
 var 
boolean = [
        [
0,0,0,1,0,2], // => across
        
[1,0,1,1,1,2], // =>
        
[2,0,2,1,2,2], // =>
    
    
[0,0,1,1,2,2],     // /| diagonals
    
[2,0,1,1,0,2],     // \|
    
        
[0,0,1,0,2,0], // v downs
        
[0,1,1,1,2,1], // v
        
[0,2,1,2,2,2]  // v
];
//  0,0 | 0,1 | 0,2
//  ---------------
//  1,0 | 1,1 | 1,2
//  ---------------
//  2,0 | 2,1 | 2,2
//

// walk boolean array and
// check board recursive, easy

// example
// var board = [
//            ["o", 1,"x"],
//            ["o","x", 1],
//            ["x", 1,  1]
//    ];
 
It's visualized in the comment.

Bam! Then make a boolean check for XX to play an O, and XXX or OOO to call it, on that one array.

Proudly NOT powered by any monopoly blogging platform, but many great thanks to Chromium/Mozilla DevTools, MAMP/Apache, and Notepad++/TextWrangler because they did all the real work here. I, Jake Jilg am just a designer.
Swatches
R
<
>
G
<
>
B
<
>
Blogs & Blogs
    • Blog under construction.
    • Blog coming soon.
    • Blog under construction.