1 Star 0 Fork 0

baitieyi / Gamettt

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
ooxx棋设计.markdown 1.17 KB
Copy Edit Raw Blame History
baitieyi authored 2017-12-18 13:10 . born

Gamettt tic tac toe

三子棋实验设计

棋盘

8 7 6  
5 4 3  
2 1 0  

置位

8 7 6 5 4 3 2 1 0 //数位
1 1 1 1 1 1 1 1 1 //棋盘
1 1 1 1 1 1 1 1 1 //红方
1 1 1 1 1 1 1 1 1 //黑方

转换

1 1 1 1 1 1 1 1 1 //parseInt(111111111,2)=511

获胜情况

8 7 6
1 1 1 0 0 0 0 0 0  //448 
      5 4 3
0 0 0 1 1 1 0 0 0  //56
            2 1 0
0 0 0 0 0 0 1 1 1  //7
8     5     2
1 0 0 1 0 0 1 0 0  //292
  7     4     1
0 1 0 0 1 0 0 1 0  //146
    6     3     0
0 0 1 0 0 1 0 0 1  //73
8       4       0
1 0 0 0 1 0 0 0 1  //273
    6   4   2
0 0 1 0 1 0 1 0 0  //84

落子

8
1 0 0 0 0 0 0 0 0  //256
  7
0 1 0 0 0 0 0 0 0  //128
    6
0 0 1 0 0 0 0 0 0  //64
      5
0 0 0 1 0 0 0 0 0  //32
        4
0 0 0 0 1 0 0 0 0  //16
          3
0 0 0 0 0 1 0 0 0  //8
            2
0 0 0 0 0 0 1 0 0  //4
              1
0 0 0 0 0 0 0 1 0  //2
                0
0 0 0 0 0 0 0 0 1  //1

裁判

判满:与[511]?==511
判占:与?==
判胜:与?==
落子:或

AI算法

分析文件ooxx棋ai(极小化极大化算法)分析.h, 来源taoyanqi8932

1
https://gitee.com/baitieyi/Gamettt.git
git@gitee.com:baitieyi/Gamettt.git
baitieyi
Gamettt
Gamettt
master

Search