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.

主站蜘蛛池模板: 日本黄色a视频| 国产成人无码久久久久毛片| 99久久精品免费观看国产| 欧美成人日韩| 国产成人AV综合久久| 在线99视频| av性天堂网| 一级毛片在线播放免费观看| 91啦中文字幕| 综合成人国产| 日韩大乳视频中文字幕| 成人夜夜嗨| 99re精彩视频| 国产一级毛片网站| 国产成人高清精品免费5388| 亚洲无码电影| 成人韩免费网站| 亚洲国产综合精品中文第一| 成人韩免费网站| 国产在线八区| 91九色最新地址| 小说区 亚洲 自拍 另类| 久久一本日韩精品中文字幕屁孩| 久久精品免费国产大片| 亚洲成肉网| 久久国产精品麻豆系列| 国产精品真实对白精彩久久| 精品久久久无码专区中文字幕| 欧美日韩在线观看一区二区三区| 伊人久久久大香线蕉综合直播| 久久久久亚洲Av片无码观看| 国产网友愉拍精品视频| 国产国产人在线成免费视频狼人色| 中国黄色一级视频| 在线无码私拍| 欧美日韩高清| 国产欧美日韩精品综合在线| 亚洲欧洲自拍拍偷午夜色| 中文字幕天无码久久精品视频免费 | 国产福利不卡视频| 人妻精品全国免费视频| 美女毛片在线| 免费国产高清视频| 重口调教一区二区视频| 久久公开视频| 本亚洲精品网站| 好紧太爽了视频免费无码| 亚洲天堂精品视频| 国产乱人免费视频| 久久一本精品久久久ー99| 九九热精品在线视频| 日韩国产综合精选| 爽爽影院十八禁在线观看| 亚洲制服丝袜第一页| 国产AV无码专区亚洲A∨毛片| 又粗又硬又大又爽免费视频播放| 欧美激情第一欧美在线| 精品色综合| 91国内在线观看| 日本不卡在线| 国产成人精品2021欧美日韩| 久久国产精品麻豆系列| 欧美一级高清免费a| www亚洲精品| 伊人久久久大香线蕉综合直播| 国产毛片不卡| jizz国产在线| 98超碰在线观看| 四虎永久在线精品影院| 欧美色99| 久久综合亚洲鲁鲁九月天| 亚洲午夜福利精品无码不卡| 99热国产在线精品99| 久久精品国产精品国产一区| 亚洲视频四区| 97国内精品久久久久不卡| 香蕉精品在线| 在线观看无码a∨| 亚洲侵犯无码网址在线观看| 亚洲精品777| 在线五月婷婷| Jizz国产色系免费|