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.

主站蜘蛛池模板: 欧美一级黄色影院| 天堂在线视频精品| 国产午夜精品一区二区三区软件| 一级爆乳无码av| 亚洲热线99精品视频| 一区二区三区国产| 欧美怡红院视频一区二区三区| 欧美日韩国产在线观看一区二区三区 | 亚洲天堂区| 欧美国产日产一区二区| 中国一级毛片免费观看| 成人免费视频一区| 青青极品在线| 久久精品嫩草研究院| 91无码视频在线观看| 人妻一区二区三区无码精品一区| 欧美午夜性视频| 久久久久久久久久国产精品| 婷婷开心中文字幕| 男女精品视频| 国产欧美日韩在线一区| 国产aaaaa一级毛片| 国产日韩精品一区在线不卡| 亚洲中文无码av永久伊人| 99国产在线视频| 欧美 国产 人人视频| 中文字幕久久波多野结衣| 国产第一页第二页| 4虎影视国产在线观看精品| 国产传媒一区二区三区四区五区| 九九视频在线免费观看| 亚洲首页国产精品丝袜| 丁香婷婷激情综合激情| 91麻豆国产视频| 欧美日韩成人在线观看 | 国产真实乱了在线播放| 国产精品专区第1页| 99爱视频精品免视看| 久久国产乱子| 午夜久久影院| 国产一区二区三区在线精品专区| 制服丝袜一区| 特级欧美视频aaaaaa| 亚洲最新地址| 欧美精品1区2区| 国产真实乱人视频| 狠狠色综合久久狠狠色综合| 亚洲国产在一区二区三区| 国产欧美在线| 精品欧美视频| 日本在线欧美在线| 亚洲成网777777国产精品| 国产精品开放后亚洲| 91亚洲视频下载| 美美女高清毛片视频免费观看| 亚洲综合狠狠| 国产精品丝袜在线| 免费国产福利| 国产午夜无码专区喷水| 欧美日韩成人在线观看| 欧美成人怡春院在线激情| 国产内射在线观看| 国产成人免费观看在线视频| 亚洲人在线| 国产亚洲现在一区二区中文| 亚洲国语自产一区第二页| 色哟哟国产精品| 国产视频一二三区| 国产好痛疼轻点好爽的视频| 国内熟女少妇一线天| 亚洲精品福利网站| 国产成人精品高清在线| 毛片网站观看| 亚洲男女天堂| 久久久无码人妻精品无码| 欧美三级不卡在线观看视频| 91 九色视频丝袜| 毛片网站在线播放| 色成人综合| 国产h视频免费观看| 国产一区二区三区在线观看免费| 91美女视频在线观看|