THE RENJU GAME BY ABHISHEK JAIN, PRANSHU GUPTA & RHYTHM DAS PCLUB SUMMER PROJECT PRESENTATION 2014 23 JUNE, L7 IIT KANPUR MENTOR – SANIL JAIN.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

DESCRIPTION: China, one of the world's oldest civilizations, consists of states and cultures dating back more than six millennia. This is an abstract.
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Computers playing games. One-player games Puzzle: Place 8 queens on a chess board so that no two queens attack each other (i.e. on the same row, same.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CS 484 – Artificial Intelligence
CHAPTER 10 FUN AND GAMES Group 1: Xiangling Liu.
Tic Tac Toe Architecture CSE 5290 – Artificial Intelligence 06/13/2011 Christopher Hepler.
Application of Artificial intelligence to Chess Playing Capstone Design Project 2004 Jason Cook Bitboards  Bitboards are 64 bit unsigned integers, with.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Artificial Intelligence in Game Design
This time: Outline Game playing The minimax algorithm
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Using Search in Problem Solving
Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.
Connect Four Michelle Chen Felix Chung Annabel Hung Raymond Wong.
Game Playing CSC361 AI CSC361: Game Playing.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
Adversarial Search: Game Playing Reading: Chess paper.
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Hex Combinatorial Search in Game Strategy by Brandon Risberg May 2006Menlo School.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
CISC 235: Topic 6 Game Trees.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Introduction to TouchDevelop
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
Prepared by : Walaa Maqdasawi Razan Jararah Supervised by: Dr. Aladdin Masri.
Renju Presented by JungYun Lo National Dong Hwa University Department of Computer Science and Information Engineering Artificial Intelligence Laboratory.
 Summary  How to Play Go  Project Details  Demo  Results  Conclusions.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Instructor: Vincent Conitzer
Connect Four AI Robert Burns and Brett Crawford. Connect Four  A board with at least six rows and seven columns  Two players: one with red discs and.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Game tree search Thanks to Andrew Moore and Faheim Bacchus for slides!
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.
AIMA Code: Adversarial Search CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth February 2005.
Adversarial Search 2 (Game Playing)
February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 1 The Alpha-Beta Procedure Can we estimate the efficiency benefit.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Adversarial Search and Game-Playing
Instructor: Vincent Conitzer
Iterative Deepening A*
Kevin Mason Michael Suggs
Instructor: Vincent Conitzer
The Alpha-Beta Procedure
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Minimax strategies, alpha beta pruning
Instructor: Vincent Conitzer
Based on slides by: Rob Powers Ian Gent
Assignment #3: Kalah.
Play to the standard rules of Ludo.
Minimax strategies, alpha beta pruning
Unit II Game Playing.
Presentation transcript:

THE RENJU GAME BY ABHISHEK JAIN, PRANSHU GUPTA & RHYTHM DAS PCLUB SUMMER PROJECT PRESENTATION JUNE, L7 IIT KANPUR MENTOR – SANIL JAIN

WHAT IS RENJU ?  RENJU is a strategy board game played by two people. One of them takes the black stone and the other one white. They place their stones by turns on the board. The player who first makes five stones (of his/her colour) in a line wins the game. The line can be in any direction, horizontal, vertical or any of the two diagonals.  The board has a grid of 15 x 15 on it such that there are 255 intersections. The stones must be placed on one of the EMPTY intersections.  The first move is always played by the player with the black stone and it must be played on the intersection at the centre of the board. After that the white player makes his/her move.

OUR PROJECT  Our project goal was to make a desktop app which would let the user play THE RENJU GAME in two different modes, one with another human player and the other with the computer, in GUI.  We coded the entire game in PYTHON, using the PYGAME and WXPYTHON libraries.  We used the MINIMAX and ALPHA BETA PRUNING algorithms for designing the AI of our game.  The boards (grids) were designed with ADOBE PHOTOSHOP and the game icon, buttons etc., were entirely designed with MICROSOFT PAINT.

ABOUT OUR APP  This is our game window, it is coded using the WXPYTHON library.  The four buttons, for the one player game, two player game, changing the theme and the about button are encoded with methods written in PYGAME.  There is also a quit button which you can use to exit this window when you are done with the game. You can also exit the window by clicking the close button on title bar.  The quit button is encoded with WXPYTHON.

THE TWO PLAYER GAME  When you click the two player game button. You are asked to enter the name of the two players and if you enter both the names and click OK, the game begins.  You click anywhere on the board and the stones are placed at the nearest intersection from the point where you clicked.  As the game continues, the app checks after each step if any of the player has made FIVE IN A LINE. If any such sequence of stones is found the game immediately stops and a message window appears declaring the winner.  As you close this window the app quits the PYGAME method. The winner’s name appears here.

THE USER INTERFACE  You can also change the theme of the board by clicking the theme button. Once you choose a theme the game will always open with that theme until you change it again.  The game also notifies you if you make an INVALID MOVE.  If the user does not know about the game, he/she can use the ABOUT button to see help content.

THE ARTIFICIAL INTELLIGENCE  OUR IMPLEMENTATION  MINIMAX is a depth first search algorithm. In our game, after the user makes his/her move, the ATTACK method is called, we have a GETMOVES method within the ATTACK method which looks for all the empty nodes adjacent to the occupied nodes. After that it calls the EVALUATE method which assigns each move a score. This score is assigned on the basis of priority of moves. For example, moves which convert a sequence of four stones into a sequence of five are assigned highest score and so on.  When the scores are assigned, the moves with highest scores are filtered out and returned as a list to the ATTACK method.

 Then, the ATTACK method runs a loop on this list. Each of these moves is played (virtually) and the ATTACK method is called again (recursively). The search is now said to have reached the depth of one from depth zero. Thus, our algorithm works as a RECURSION TREE.  In this call, the computer has already made its move, so the EVALUATE method turns to the HUMAN PLAYER’S POINT OF VIEW. Now the GETMOVES method will search for the available moves and EVALUATE them according to the human player. Then the moves with highest score (in Human player’s point of view) are returned.  Now, these moves are virtually played on the behalf of the human player and then ATTACK method is called again, increasing the depth to TWO.  Thus, we have tried to implement the concept of PERFECT PLAY from both players. The ATTACK method searches up to the DEPTH OF FOUR.  When the last branch of the fourth depth is visited then the corresponding move and score are stored and compared with previous move’s score. The move with greater score is replaced with the previously stored move. The depth now starts rolling back and the move which is stored at depth zero is assigned to a variable named BESTMOVE.  The BESTMOVE is then appended to the CPU player, and the human player makes his/her next move and the game continues.

ALPHA BETA PRUNING  Alpha–beta pruning is a search algorithm that seeks to decrease the number of nodes that are evaluated by the minimax algorithm in its search tree. It stops completely evaluating a move when at least one possibility has been found that proves the move to be worse than a previously examined move. Such moves need not be evaluated further. When applied to a standard minimax tree, it returns the same move as minimax would, but prunes away branches that cannot possibly influence the final decision.  We have also applied ALPHA BETA PRUNING in our MINIMAX algorithm.

THANK YOU ! With special thanks to SANIL JAIN and PANKAJ PRATIK …………….! PRESENTED BY PRANSHU GUPTA, RHYTHM DAS & ABHISHEK JAIN FOR PCLUB SUMMER CAMP 2014