GAMESMAN a Finite, Two-Person, Perfect-Information Game Generator

Total Page:16

File Type:pdf, Size:1020Kb

GAMESMAN a Finite, Two-Person, Perfect-Information Game Generator GAMESMAN A finite, two-person, perfect-information game generator by Daniel Dante Garcia ([email protected]) B.S. Computer Science and Engineering (Massachusetts Institute of Technology) 1990 B.S. Electrical Engineering (Massachusetts Institute of Technology) 1990 A report submitted in partial satisfaction of the requirements for the degree of Master of Science in Computer Science in the GRADUATE DIVISION of the UNIVERSITY of CALIFORNIA at BERKELEY Committee in charge: Professor Elwyn R. Berlekamp, Chair Professor Brian A. Barsky Abstract “Why write a program when you can write a program to write a program?” – Author unknown This report introduces GAMESMAN, a system for generating graphical parametrizable game applications. Programmers write game ‘modules’ for a specific game, which when combined with our libraries, compile together to become stand- alone X-window applications as shown in Figure A.1 below. The modules only need contain information about the rules of the game and how the game ends. If the game is small-enough, it may be solved, and the computer can play the role of an oracle, or “perfect” opponent. This oracle can advise a novice player how to play, and teach the strategy of the game even though none was programmed into the system! If a game is too large to be solved exhaustively, the game programmer can add heuristics to provide an imperfect computer opponent. Finally, the application can provide a useful utility to two human players who are playing each other, since it be a “referee” who constrains the users’ moves to be only valid moves, can update the board to respond to the move, and can signal when one of the players has won. module for module for module for module for 1210 TicTacToe Tac Tix dodgem GAMESMAN X and text X and text X and text X and text application application application application for for for for 1210 TicTacToe Tac Tix dodgem Figure Abstract.1: The Overall Picture of GAMESMAN 1 Dedication To my parents, Raymond and Deborah, whose enduring love and simple, generous acts of allowing their 6-year-old son to play when he needed to play and to beat them at chess fostered a love for games that has not abated in the 21 years since. - i - Table of Contents 1. Introduction....................................................................................1 2. Definition of Terms ........................................................................2 2.1 Position ........................................................................................ 2 2.2 Slot ............................................................................................... 2 2.3 Piece .............................................................................................2 2.4 Move .............................................................................................3 2.5 Value, or Outcome....................................................................... 3 2.5.1. Win ............................................................................................ 5 2.5.2. Lose ........................................................................................... 5 2.5.3. Tie.............................................................................................. 6 2.5.4. Primitive positions and terminating criteria .......................... 6 2.5.5. Value-equivalent moves. .......................................................... 6 2.6 Perfect opponents ........................................................................7 2.7 Partisan vs. Impartial games ..................................................... 7 2.8 The misère game vs. the standard game ................................... 8 2.9 Solving games..............................................................................9 2.10 Static-evaluation ......................................................................... 9 2.11 MINIMAX Heuristic.................................................................. 11 3. Prior Work .................................................................................... 13 3.1 David Wolfe’s games toolkit...................................................... 13 3.2 Anders Kierulf’s Smart Game Board ....................................... 14 3.3 Rhys Hollow’s Gamemaster...................................................... 15 3.4 What does GAMESMAN provide?............................................ 16 4. What games can be solved by GAMESMAN?............................. 17 4.1 Finite.......................................................................................... 17 4.2 2-Person ..................................................................................... 17 4.3 Perfect Information ................................................................... 18 5. What are the mechanics of generating a game?......................... 20 5.1 Set global variables ................................................................... 20 5.2 Choose a Representation for Positions and Moves.................. 20 5.3 Additional issues if the game is to be solved ........................... 21 5.3.1. Compact .................................................................................. 21 5.3.2. Unique ..................................................................................... 21 5.3.3. Constant-Time Mapping Function ........................................ 22 5.3.4. Example: Tic-Tac-Toe ............................................................. 22 5.4 Write the Subroutines............................................................... 22 6. Categorizing Games..................................................................... 24 6.1 Categorizing games by total number of positions ................... 24 6.1.1. Dart-Board without Capture ................................................. 24 6.1.1.1 Number of moves upper bound ........................................... 25 6.1.1.2 Number of positions upper bound....................................... 25 - ii - 6.1.1.3 Examples .............................................................................. 26 6.1.2. Dart-Board with Capture ....................................................... 26 6.1.2.1 Number of moves upper bound ........................................... 26 6.1.2.2 Number of positions upper bound....................................... 27 6.1.2.3 Examples .............................................................................. 27 6.1.3. Rearranger .............................................................................. 27 6.1.3.1 Number of moves upper bound ........................................... 27 6.1.3.2 Number of positions upper bound....................................... 28 6.1.3.3 Examples .............................................................................. 28 6.1.4. Impartial Removal.................................................................. 28 6.1.4.1 Number of moves upper bound ........................................... 28 6.1.4.2 Number of positions upper bound....................................... 29 6.1.4.3 Examples .............................................................................. 29 6.1.5. Partisan Removal ................................................................... 29 6.1.5.1 Number of moves upper bound ........................................... 29 6.1.5.2 Number of positions upper bound....................................... 29 6.1.5.3 Examples .............................................................................. 30 6.1.6. Hybrids.................................................................................... 30 6.1.7. Comparisons............................................................................ 30 6.2 Categorizing games by type of interactions............................. 31 6.2.1. Single-piece removal/placement ............................................ 32 6.2.2. Single-piece movement........................................................... 32 6.2.3. Multiple-piece removal/placement......................................... 32 6.2.4. Multiple-piece movement ....................................................... 33 6.2.5. Hybrids.................................................................................... 33 6.3 Examples of the categories of popular games.......................... 33 7. User Interface Issues ................................................................... 35 7.1 Customization: giving users the options .................................. 35 7.2 Interactively choosing a move .................................................. 35 7.2.1. Single-piece removal/placement ............................................ 36 7.2.2. Single-piece movement........................................................... 36 7.2.2.1 Outline vs. Opaque drags .................................................... 37 7.2.2.2 Computer-assisted movements ........................................... 37 7.2.3. Multiple-piece removal/placement......................................... 38 7.2.3.1 Single toggle click ................................................................ 39 7.2.3.2 Click-drag selection rectangle ............................................. 39 7.2.3.3 Click-drag selection line ...................................................... 40 7.2.4. Multiple-piece movement ....................................................... 41 7.2.4.1 Group select and move......................................................... 41 7.2.4.2 Individual select and move.................................................
Recommended publications
  • Solving 8 × 8 Domineering
    Theoretical Computer Science 230 (2000) 195–206 www.elsevier.com/locate/tcs View metadata, citation and similar papers at core.ac.uk brought to you by CORE Mathematical Games provided by Elsevier - Publisher Connector Solving 8 × 8 Domineering D.M. Breuker, J.W.H.M. Uiterwijk ∗, H.J. van den Herik Department of Computer Science, MATRIKS Research Institute, Universiteit Maastricht, P.O. Box 616, 6200 MD Maastricht, Netherlands Received May 1998; revised October 1998 Communicated by A.S. Fraenkel Abstract So far the game of Domineering has mainly been investigated by combinatorial-games re- searchers. Yet, it is a genuine two-player zero-sum game with perfect information, of which the general formulation is a topic of AI research. In that domain, many techniques have been developed for two-person games, especially for chess. In this article we show that one such technique, i.e., transposition tables, is ÿt for solving standard Domineering (i.e., on an 8×8 board). The game turns out to be a win for the player ÿrst to move. This result coincides with a result obtained independently by Morita Kazuro. Moreover, the technique of transposition tables is also applied to di erently sized m × n boards, m ranging from 2 to 8, and n from m to 9. The results are given in tabular form. Finally, some conclusions on replacement schemes are drawn. In an appendix an analysis of four tournament games is provided. c 2000 Published by Elsevier Science B.V. All rights reserved. Keywords: Domineering; Solving games; Transposition tables; Replacement schemes 1. Introduction Domineering is a two-player zero-sum game with perfect information.
    [Show full text]
  • Bibliography of Traditional Board Games
    Bibliography of Traditional Board Games Damian Walker Introduction The object of creating this document was to been very selective, and will include only those provide an easy source of reference for my fu- passing mentions of a game which give us use- ture projects, allowing me to find information ful information not available in the substan- about various traditional board games in the tial accounts (for example, if they are proof of books, papers and periodicals I have access an earlier or later existence of a game than is to. The project began once I had finished mentioned elsewhere). The Traditional Board Game Series of leaflets, The use of this document by myself and published on my web site. Therefore those others has been complicated by the facts that leaflets will not necessarily benefit from infor- a name may have attached itself to more than mation in many of the sources below. one game, and that a game might be known Given the amount of effort this document by more than one name. I have dealt with has taken me, and would take someone else to this by including every name known to my replicate, I have tidied up the presentation a sources, using one name as a \primary name" little, included this introduction and an expla- (for instance, nine mens morris), listing its nation of the \families" of board games I have other names there under the AKA heading, used for classification. and having entries for each synonym refer the My sources are all in English and include a reader to the main entry.
    [Show full text]
  • By Glenn A. Emelko
    A NEW ALGORITHM FOR EFFICIENT SOFTWARE IMPLEMENTATION OF REED-SOLOMON ENCODERS FOR WIRELESS SENSOR NETWORKS by Glenn A. Emelko Submitted to the Office of Graduate Studies at Case Western Reserve University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY in ELECTRICAL ENGINEERING Department of Electrical Engineering and Computer Science Case Western Reserve University Glennan 321, 10900 Euclid Ave. Cleveland, Ohio 44106 May 2009 CASE WESTERN RESERVE UNIVERSITY SCHOOL OF GRADUATE STUDIES We hereby approve the thesis/dissertation of _Glenn A. Emelko____________________________________ candidate for the _Doctor of Philosophy_ degree *. (signed)_Francis L. Merat______________________________ (chair of the committee) _Wyatt S. Newman______________________________ _H. Andy Podgurski_____________________________ _William L. Schultz______________________________ _David A. Singer________________________________ ________________________________________________ (date) _March 2, 2009__________ * We also certify that written approval has been obtained for any proprietary material contained therein. i Dedication For my loving wife Liz, and for my children Tom and Leigh Anne. I thank you for giving me love and support and for believing in me every step along my journey. ii Table of Contents Dedication........................................................................................................................... ii List of Figures......................................................................................................................4
    [Show full text]
  • Claude Elwood Shannon (1916–2001) Solomon W
    Claude Elwood Shannon (1916–2001) Solomon W. Golomb, Elwyn Berlekamp, Thomas M. Cover, Robert G. Gallager, James L. Massey, and Andrew J. Viterbi Solomon W. Golomb Done in complete isolation from the community of population geneticists, this work went unpublished While his incredibly inventive mind enriched until it appeared in 1993 in Shannon’s Collected many fields, Claude Shannon’s enduring fame will Papers [5], by which time its results were known surely rest on his 1948 work “A mathematical independently and genetics had become a very theory of communication” [7] and the ongoing rev- different subject. After his Ph.D. thesis Shannon olution in information technology it engendered. wrote nothing further about genetics, and he Shannon, born April 30, 1916, in Petoskey, Michi- expressed skepticism about attempts to expand gan, obtained bachelor’s degrees in both mathe- the domain of information theory beyond the matics and electrical engineering at the University communications area for which he created it. of Michigan in 1936. He then went to M.I.T., and Starting in 1938 Shannon worked at M.I.T. with after spending the summer of 1937 at Bell Tele- Vannevar Bush’s “differential analyzer”, the an- phone Laboratories, he wrote one of the greatest cestral analog computer. After another summer master’s theses ever, published in 1938 as “A sym- (1940) at Bell Labs, he spent the academic year bolic analysis of relay and switching circuits” [8], 1940–41 working under the famous mathemati- in which he showed that the symbolic logic of cian Hermann Weyl at the Institute for Advanced George Boole’s nineteenth century Laws of Thought Study in Princeton, where he also began thinking provided the perfect mathematical model for about recasting communications on a proper switching theory (and indeed for the subsequent mathematical foundation.
    [Show full text]
  • Jeanne's Favorite Games
    Jeanne’s Favorite Games Game Maker Cognitive functions/operations For Younger Children Blink Out of the Box games comparing at a high rate of speed Toot and Otto Thinkfun planning, hypothetical thinking, sequencing Barnyard Critters Rio Grande Games logic, hypothetical thinking, non competitive LCR (fun family game) George and Co. LLC spatial sense for left and right Open Sesame Ravensburger memory for spatial relationships Walk the Dogs Simply Fun planning, visual transport The Storybook Game Fundex memory, vocabulary, sequencing, forming relationships Camelot Jr. Smart Games hypothetical thinking, logical evidence, planning, Feed the Kitty Gamewright visual representation, spatial orientation Quick Cups Spin Master visual processing speed, color sequencing Go Ape (great family game) Play Monster identify emotions, reading body language Rat-a-tat-tat (card game) Gamewright memory, numbers, planning, relevant cues Penguins On Ice Smart Games spatial sense, hypothetical thinking, planning Slapzi Carma Games language development, understanding negatives (no or not), relevant cues, processing speed Tenzi (fun for groups) Carma Games matching numbers, systematic search, visual processing speed, tons of fun, buy the additional pack of cards “77 Ways to Play Tenzi” Older Children - Adult Skribble TDC Games visualizing, planning, predicting Take Your Pick Simply Fun point of view, predicting Linkity Simply Fun forming relationships, Squint Junior Out of the Box games visualizing, analyzing-integrating, Khet (a very cool laser game) www.khet.com
    [Show full text]
  • Hexaflexagons, Probability Paradoxes, and the Tower of Hanoi
    HEXAFLEXAGONS, PROBABILITY PARADOXES, AND THE TOWER OF HANOI For 25 of his 90 years, Martin Gard- ner wrote “Mathematical Games and Recreations,” a monthly column for Scientific American magazine. These columns have inspired hundreds of thousands of readers to delve more deeply into the large world of math- ematics. He has also made signifi- cant contributions to magic, philos- ophy, debunking pseudoscience, and children’s literature. He has produced more than 60 books, including many best sellers, most of which are still in print. His Annotated Alice has sold more than a million copies. He continues to write a regular column for the Skeptical Inquirer magazine. (The photograph is of the author at the time of the first edition.) THE NEW MARTIN GARDNER MATHEMATICAL LIBRARY Editorial Board Donald J. Albers, Menlo College Gerald L. Alexanderson, Santa Clara University John H. Conway, F.R. S., Princeton University Richard K. Guy, University of Calgary Harold R. Jacobs Donald E. Knuth, Stanford University Peter L. Renz From 1957 through 1986 Martin Gardner wrote the “Mathematical Games” columns for Scientific American that are the basis for these books. Scientific American editor Dennis Flanagan noted that this column contributed substantially to the success of the magazine. The exchanges between Martin Gardner and his readers gave life to these columns and books. These exchanges have continued and the impact of the columns and books has grown. These new editions give Martin Gardner the chance to bring readers up to date on newer twists on old puzzles and games, on new explanations and proofs, and on links to recent developments and discoveries.
    [Show full text]
  • Chapter 6 Two-Player Games
    Introduction to Using Games in Education: A Guide for Teachers and Parents Chapter 6 Two-Player Games There are many different kinds of two-person games. You may have played a variety of these games such as such as chess, checkers, backgammon, and cribbage. While all of these games are competitive, many people play them mainly for social purposes. A two-person game environment is a situation that facilitates communication and companionship. Two major ideas illustrated in this chapter: 1. Look ahead: learning to consider what your opponent will do as a response to a move that you are planning. 2. Computer as opponent. In essence, this makes a two-player game into a one- player game. In addition, we will continue to explore general-purpose, high-road transferable, problem-solving strategies. Tic-Tac-Toe To begin, we will look at the game of tic-tac-toe (TTT). TTT is a two-player game, with players taking turns. One player is designated as X and the other as O. A turn consists of marking an unused square of a 3x3 grid with one’s mark (an X or an O). The goal is to get three of one’s mark in a file (vertical, horizontal, or diagonal). Traditionally, X is the first player. A sample game is given below. Page 95 Introduction to Using Games in Education: A Guide for Teachers and Parents X X X O X O Before X's O's X's game first first second begins move move move X X X X O X X O X O O O X O X O X O X O X O O's X's O's X wins on second third third X's fourth move move move move Figure 6.1.
    [Show full text]
  • Inventaire Des Jeux Combinatoires Abstraits
    INVENTAIRE DES JEUX COMBINATOIRES ABSTRAITS Ici vous trouverez une liste incomplète des jeux combinatoires abstraits qui sera en perpétuelle évolution. Ils sont classés par ordre alphabétique. Vous avez accès aux règles en cliquant sur leurs noms, si celles-ci sont disponibles. Elles sont parfois en anglais faute de les avoir trouvées en français. Si un jeu vous intéresse, j'ai ajouté une colonne « JOUER EN LIGNE » où le lien vous redirigera vers le site qui me semble le plus fréquenté pour y jouer contre d'autres joueurs. J'ai remarqué 7 catégories de ces jeux selon leur but du jeu respectif. Elles sont décrites ci-dessous et sont précisées pour chaque jeu. Ces catégories sont directement inspirées du livre « Le livre des jeux de pions » de Michel Boutin. Si vous avez des remarques à me faire sur des jeux que j'aurai oubliés ou une mauvaise classification de certains, contactez-moi via mon blog (http://www.papatilleul.fr/). La définition des jeux combinatoires abstraits est disponible ICI. Si certains ne répondent pas à cette définition, merci de me prévenir également. LES CATÉGORIES CAPTURE : Le but du jeu est de capturer ou de bloquer un ou plusieurs pions en particulier. Cette catégorie se caractérise souvent par une hiérarchie entre les pièces. Chacune d'elle a une force et une valeur matérielle propre, résultantes de leur capacité de déplacement. ELIMINATION : Le but est de capturer tous les pions de son adversaire ou un certain nombre. Parfois, il faut capturer ses propres pions. BLOCAGE : Il faut bloquer son adversaire. Autrement dit, si un joueur n'a plus de coup possible à son tour, il perd la partie.
    [Show full text]
  • Combinatorial Game Theory
    Combinatorial Game Theory Aaron N. Siegel Graduate Studies MR1EXLIQEXMGW Volume 146 %QIVMGER1EXLIQEXMGEP7SGMIX] Combinatorial Game Theory https://doi.org/10.1090//gsm/146 Combinatorial Game Theory Aaron N. Siegel Graduate Studies in Mathematics Volume 146 American Mathematical Society Providence, Rhode Island EDITORIAL COMMITTEE David Cox (Chair) Daniel S. Freed Rafe Mazzeo Gigliola Staffilani 2010 Mathematics Subject Classification. Primary 91A46. For additional information and updates on this book, visit www.ams.org/bookpages/gsm-146 Library of Congress Cataloging-in-Publication Data Siegel, Aaron N., 1977– Combinatorial game theory / Aaron N. Siegel. pages cm. — (Graduate studies in mathematics ; volume 146) Includes bibliographical references and index. ISBN 978-0-8218-5190-6 (alk. paper) 1. Game theory. 2. Combinatorial analysis. I. Title. QA269.S5735 2013 519.3—dc23 2012043675 Copying and reprinting. Individual readers of this publication, and nonprofit libraries acting for them, are permitted to make fair use of the material, such as to copy a chapter for use in teaching or research. Permission is granted to quote brief passages from this publication in reviews, provided the customary acknowledgment of the source is given. Republication, systematic copying, or multiple reproduction of any material in this publication is permitted only under license from the American Mathematical Society. Requests for such permission should be addressed to the Acquisitions Department, American Mathematical Society, 201 Charles Street, Providence, Rhode Island 02904-2294 USA. Requests can also be made by e-mail to [email protected]. c 2013 by the American Mathematical Society. All rights reserved. The American Mathematical Society retains all rights except those granted to the United States Government.
    [Show full text]
  • CONNECT6 I-Chen Wu1, Dei-Yen Huang1, and Hsiu-Chen Chang1
    234 ICGA Journal December 2005 NOTES CONNECT6 1 1 1 I-Chen Wu , Dei-Yen Huang , and Hsiu-Chen Chang Hsinchu, Taiwan ABSTRACT This note introduces the game Connect6, a member of the family of the k-in-a-row games, and investigates some related issues. We analyze the fairness of Connect6 and show that Connect6 is potentially fair. Then we describe other characteristics of Connect6, e.g., the high game-tree and state-space complexities. Thereafter we present some threat-based winning strategies for Connect6 players or programs. Finally, the note describes the current developments of Connect6 and lists five new challenges. 1. INTRODUCTION Traditionally, the game k-in-a-row is defined as follows. Two players, henceforth represented as B and W, alternately place one stone, black and white respectively, on one empty square2 of an m × n board; B is assumed to play first. The player who first obtains k consecutive stones (horizontally, vertically or diagonally) of his own colour wins the game. Recently, Wu and Huang (2005) presented a new family of k-in-a-row games, Connect(m,n,k,p,q), which are analogous to the traditional k-in-a-row games, except that B places q stones initially and then both W and B alternately place p stones subsequently. The additional parameter q is a key that significantly influences the fairness. The games in the family are also referred to as Connect games. For simplicity, Connect(k,p,q) denotes the games Connect(∞,∞,k,p,q), played on infinite boards. A well-known and popular Connect game is five-in-a-row, also called Go-Moku.
    [Show full text]
  • SHANNON SYMPOSIUM and STATUE DEDICATION at UCSD
    SHANNON SYMPOSIUM and STATUE DEDICATION at UCSD At 2 PM on October 16, 2001, a statue of Claude Elwood Shannon, the Father of Information Theory who died earlier this year, will be dedicated in the lobby of the Center for Magnetic Recording Research (CMRR) at the University of California-San Diego. The bronze plaque at the base of this statue will read: CLAUDE ELWOOD SHANNON 1916-2001 Father of Information Theory His formulation of the mathematical theory of communication provided the foundation for the development of data storage and transmission systems that launched the information age. Dedicated October 16, 2001 Eugene Daub, Sculptor There is no fee for attending the dedication but if you plan to attend, please fill out that portion of the attached registration form. In conjunction with and prior to this dedication, 15 world-renowned experts on information theory will give technical presentations at a Shannon Symposium to be held in the auditorium of CMRR on October 15th and the morning of October 16th. The program for this Symposium is as follows: Monday Oct. 15th Monday Oct. 15th Tuesday Oct. 16th 9 AM to 12 PM 2 PM to 5 PM 9 AM to 12 PM Toby Berger G. David Forney Jr. Solomon Golomb Paul Siegel Edward vanderMeulen Elwyn Berlekamp Jacob Ziv Robert Lucky Shu Lin David Neuhoff Ian Blake Neal Sloane Thomas Cover Andrew Viterbi Robert McEliece If you are interested in attending the Shannon Symposium please fill out the corresponding portion of the attached registration form and mail it in as early as possible since seating is very limited.
    [Show full text]
  • RENJU for BEGINNERS Written by Mr. Alexander NOSOVSKY and Mr
    RENJU FOR BEGINNERS written by Mr. Alexander NOSOVSKY and Mr. Andrey SOKOLSKY NEW REVISED EDITION 4 9 2 8 6 1 X 7 Y 3 5 10 1999 PREFACE This excellent book on Renju for beginners written by Mr Alexander Nosovsky and Mr Andrey Sokolsky was the first reference book for the former USSR players for a long time. As President of the RIF (The Renju International Federation) I am very glad that I can introduce this book to all the players around the world. Jonkoping, January 1990 Tommy Maltell President of RIF PREFACE BY THE AUTHORS The rules of this game are much simpler, than the rules of many other logical games, and even children of kindergarten age can study a simple variation of it. However, Renju does not yield anything in the number of combinations, richness in tactical and strategical ideas, and, finally, in the unexpectedness and beauty of victories to the more popular chess and checkers. A lot of people know a simple variation of this game (called "five-in-a-row") as a fascinating method to spend their free time. Renju, in its modern variation, with simple winnings prohibited for Black (fouls 3x3, 4x4 and overline ) becomes beyond recognition a serious logical-mind game. Alexander Nosovsky Vice-president of RIF Former two-times World Champion in Renju by mail. Andrey Sokolsky Former vice-president of RIF . CONTENTS CHAPTER 1. INTRODUCTION. 1.1 The Rules of Renju . 1.2 From the History and Geography of Renju . CHAPTER 2. TERMS AND DEFINITIONS . 2.1 Accessories of the game .
    [Show full text]