1 / 11

SOS - The Game

SOS - The Game. A Project by Paritosh J Chandran Prakhar Bharadwaj Ganesh Mahidhar Nagarjun Srinivasan. Rules of SOS. Two people, here , the computer and you play against each other

gamba
Download Presentation

SOS - The Game

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SOS - The Game A Project by ParitoshJ Chandran PrakharBharadwaj Ganesh Mahidhar NagarjunSrinivasan

  2. Rules of SOS • Two people, here, the computer and you play against each other • Both the players play the same card, i.e. An “S” or an “O” alternatively, in terms of both the card and the play • The one who forms SOS in a horizontal or vertical line • In our version of the game diagonal victory are not allowed

  3. About the Program • The program began in hopes of achieving AI • As of now the program just follows certain rules defined in the source code • Which basically entails that the program has a set of defined rules, checks and moves(such as double tricks, wins etc.) • The rules and checks are pre-defined by the rules of the game

  4. The moves to entice a sure win each time has been developed the project team • Logic for each move has been tried and tested • In the future what we hope to achieve is a program that can learn from its mistakes and play. Like a human basically against players

  5. Working of the Program • The program first begins by checking if a player has won • Then, it looks if it can finish a win by playing a good move, if not, it checks if the player it’s playing against can win in his next move and the program prevents such a move from happening • If the above 2 situations don’t arise, then, the program proceeds to make a set of pre-defined double tricks(defined by the project team) • If no such possibility is present, the computer plays a neutral/random move such that it does not hinder its chances of winning or being held in a double trick by the player

  6. Variables Used • Ch – Two dimensional character array • I, j – Loop variables • Tot – Total number of moves made so far • Turnmade – Keeps track of which move has been made and who has made it • Win – flag variable • G, h – input values from user

  7. Functions Used • Print() – Prints the present status of the board • Main() – Primary function of the program. This programme contains the code on how the game should move on. What plays the computer should make and ultimately win. The main() function is the most important part of the program

  8. Screen-Shot 1

  9. Screen-Shot 2

  10. Screen-Shot 3

  11. Screen-Shot 4

More Related