亚洲免费av电影一区二区三区,日韩爱爱视频,51精品视频一区二区三区,91视频爱爱,日韩欧美在线播放视频,中文字幕少妇AV,亚洲电影中文字幕,久久久久亚洲av成人网址,久久综合视频网站,国产在线不卡免费播放

        ?

        The design and analysis of tic tac toe

        2017-03-31 08:28:12ZhangYiHeng
        校園英語(yǔ)·下旬 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蜜桃| 国产tv不卡免费在线观看 | 色婷婷五月综合激情中文字幕| 日本老熟妇毛茸茸| 91精品国产福利尤物免费| 日本免费a一区二区三区| 一区二区精品国产亚洲| 双腿张开被9个男人调教| 亚洲日韩精品欧美一区二区三区不卡| av福利资源在线观看| 日韩精品在线视频一二三| 欧美 国产 综合 欧美 视频| 亚洲精品二区中文字幕| 东京道一本热码加勒比小泽| 免费在线观看视频播放| 亚洲av无码之国产精品网址蜜芽| 91天堂素人精品系列全集亚洲| 亚洲精品女同在线观看| 丰满人妻一区二区三区视频| 国产精品成人国产乱| 免费看国产精品久久久久| 伊人婷婷综合缴情亚洲五月| 国产欧美性成人精品午夜| 无码人妻一区二区三区免费| 国产精品天干天干在线观蜜臀| 91精品久久久中文字幕| 亚洲国产av精品一区二区蜜芽| 四虎精品成人免费观看| 日本高清免费播放一区二区| 日本少妇高潮喷水视频| 四虎影库久免费视频| 无码伊人久久大香线蕉| 国产成人亚洲一区二区| 亚洲av无码xxx麻豆艾秋| 欧美成人免费看片一区| 男女打扑克视频在线看| 中文无码成人免费视频在线观看| 久久久久亚洲av无码专区| 黄色大片一区二区中文字幕|