999精品在线视频,手机成人午夜在线视频,久久不卡国产精品无码,中日无码在线观看,成人av手机在线观看,日韩精品亚洲一区中文字幕,亚洲av无码人妻,四虎国产在线观看 ?

The design and analysis of tic tac toe

2017-03-31 08:28:12ZhangYiHeng
校園英語·下旬 2016年12期

ZhangYi+Heng

【Abstract】Tic tac toe is a small-scaled application developed to simulate a situation of the game tic tac toe, with two players: computer and the user. The application intends on guaranteeing a winning or at least a draw outcome for the computer by playing its each move. Based on the objected-oriented idea, the application is also developed to show the branch of artificial intelligence and game theory using the simple game as an example. Therefore, the essay presents the applications algorithms and its theory behind it with an aim to further explain the theoretical and practical use of the application.

【Key words】small-scaled application; object-oriented; game theory

1. Introduction

Tic tac toe is developed and achieved based on the notion programming. It also adopts theories, such as game theory, to simulate an imaginary game between two players.

It appears simple to create the chessboard and have a game with players and similarly simple for the computer to take moves according to tactics and strategies that often depend highly on game designs to take effect. Nevertheless, the application aims not on the calculation and deduction capable of applying only on the game tic tac toe, but the game theory behind it. The theory, in this context, enables the optimal calculation considering all results and is theoretically applicable to all types of chessboard game. But unlike the naive solution, the theory wisely omits a considerable part of calculation and ensures a winning or at least a draw for the computer side.

The theory is achieved though the design of the application which is divided into two parts: main game process and interaction and an additional part attaching to the game process —the AI. The game process creates the situation of the game, including the simulation of a chessboard, some chessmen, two players (one is AI), a judge and a loop. The interaction part passes the users operations to the game process and sends back the calculated information, including the computers move and the location of the chessmen to the user interface (UI) back to the user with an aim to continue the game loop.

2. Basic theory

2.1 Game theory

Wildly used as it appears in maths, logic and typically computer sciences, the game theory guides and helps play correct moves on the computer side, profits maximized while losses minimized. In a zero-sum game like the tic tac toe, where one participants gains are exactly balanced by other participants —in this game, the opponents—losses, players are forced to make their max gains at each move. Hence, theoretically speaking, the prediction of opponents move is only and clear. Then what is left to search through is a tree that considers both sides moves and ends once the result is clear. By avoiding any branches leading to losing and preferring those of winning, the computer is unbeatable because of the game its self is designed all but fair(regardless to the first-move advantage), 50-50 chance for either side to win.

3. The design

3.1 The game process and interaction

The object-oriented application completes the game process by two steps: the static items, roles and rules and the dynamic game loop. Using constructors, the application begins with the creation of the elements, including chessmen, chessboard, the AI, the judge and the encapsulation of these elements into the class play, and finally reset each element to initialize a new game before it starts. During the loop, the not only object- but user-oriented game take the loop in a convenient way, in which the loop pauses and continues only after the user has taken a legal move. Therefore, the loop is not normally constructed by a pausing function for UI-background interaction named button click, which transits the users operation into computer data and calls AI afterwards. Under the direction of this function, the game loop is designed to work from button click to AI and back to button click as normal players are playing the game in turns.

3.2 AI

The AI achieves an adoption of the game theory to the application. It instructs the computer to think like a common human with a thousand folds more of calculation ability. Normally, a human player would avert all the potential results that lead to failure if none is left of those that prove advantageous, similar to minimax. Based on the game theory, so does the computer think like human players, Diagram is shown in figure 1.

4. Conclusion

For both entertainment and study purposes, the application recreates a game, establishes Artificial intelligence applying in that game and thus shifts the calculation successfully from human to computer. The development of tic tac toe specifies the transition between theories and application, visible images and digital data, and between reality and virtual simulation. In the meantime, it stresses and put into practice the framework and outline design that clear thinking and programming problems to a significant extent.

References:

[1]Game theory is “the study of mathematical model of conflict and cooperation between intelligent rational decision-makers”,which is mainly used in economy,political science and psychology,as well as computer science,according to https://en.wikipedia.org/wiki/Game_theory.

[2]A Zero-Sum Games is a mathematical representation of a situation in which each participant's gain(or loss)of utility is exactly balanced by the losses(or gains)of the utility of the other participant(s).More information on https://en.wikipedia.org/wiki/Utility.

[3]Minimax is a decision rule used in decision theory,game theory,statistics and philosophy for minimizing the possible loss for a worst case scenario.More information on https://en.wikipedia.org/wiki/Minima.

主站蜘蛛池模板: 无码一区18禁| 黄色网在线| 亚洲天堂日韩在线| 国产免费久久精品99re不卡| 91九色最新地址| 天堂成人在线| 亚洲一区毛片| 久久亚洲国产一区二区| 欧美日韩北条麻妃一区二区| 精品无码日韩国产不卡av| 国产精品国产三级国产专业不| 亚洲综合精品第一页| 精品久久久无码专区中文字幕| 久久免费视频6| 全午夜免费一级毛片| 国产精品亚洲精品爽爽| 四虎永久在线精品国产免费| 在线观看欧美国产| 国产最新无码专区在线| 九九热在线视频| 亚洲日韩精品伊甸| 国产成本人片免费a∨短片| 成人a免费α片在线视频网站| 亚洲国产成人精品无码区性色| 99久久国产精品无码| 亚洲不卡影院| 国产大全韩国亚洲一区二区三区| 99久久精彩视频| 欧美区一区| 亚洲精品国产精品乱码不卞 | 青青热久免费精品视频6| 亚洲欧美日韩成人在线| 波多野结衣一区二区三区四区视频 | 成人午夜视频免费看欧美| 国产精品 欧美激情 在线播放| 暴力调教一区二区三区| 黄色一级视频欧美| 亚洲国产AV无码综合原创| 尤物成AV人片在线观看| 999精品视频在线| 最新加勒比隔壁人妻| 国产凹凸视频在线观看| 国产黄色爱视频| 有专无码视频| 国产剧情国内精品原创| 欧美日韩高清在线| 国产尤物视频在线| 日韩毛片免费| 午夜啪啪福利| 2021国产精品自产拍在线观看 | 中国国产高清免费AV片| 老色鬼久久亚洲AV综合| 91精品小视频| 婷婷伊人久久| 2020国产在线视精品在| 91在线国内在线播放老师| 国产人免费人成免费视频| 中文字幕在线看| 成AV人片一区二区三区久久| 亚洲天堂免费观看| 欧美日韩精品综合在线一区| 欧美午夜一区| 国产精品久久久久久影院| 538国产在线| 日韩精品毛片人妻AV不卡| 97精品国产高清久久久久蜜芽| 亚洲性视频网站| 国产成人高清精品免费5388| 欧美a网站| 99re视频在线| 国产成人一区在线播放| 99手机在线视频| 国产精品无码一区二区桃花视频| 91视频免费观看网站| 国产精品区网红主播在线观看| 国产成人盗摄精品| 久久婷婷六月| 动漫精品啪啪一区二区三区| 亚洲国产成熟视频在线多多| 少妇精品在线| 国产主播一区二区三区| 欧美性猛交xxxx乱大交极品|