AI CHALLENGEIntroduction:Connect Four (also known as Captains Mistress, Four Up, Plot Four, Find Four, Fourplay,Four in a Row and Four in a Line) is a two-player game in which the players first choose acolour and then take turns dropping their colour discs from the top into a seven-column, six-row vertically-suspended grid. The pieces fall straight down, occupying the next availablespace within the column. The object of the game is to connect four of ones own discs of thesame colour next to each other vertically, horizontally, or diagonally before ones opponentcan do so.Does this sound pretty simple..!!?? So here comes the twist. No more boring gameplay withonly the normal colour disks falling to their places. If u fell that you made a bad move oryour opponent played a tricky move then you will get a chance to ruin his strategy by usingyour powers. In this game of power connect 4 you will get 4 types of special powers, one ofeach of them per set.So what do you say, now can u overpower your opponent. Can you line up four discs in arow before your opponent does?Problem Statement:The teams have to submit codes for an artificial intelligence which can play a completegame of power connect 4. At a time, two codes will play the game of power connect 4.Framework:The competition aims to provide an interface for codes of different teams to simultaneouslyplay the modified version of the famous game ‘CONNECT FOUR’ which is also know by thename ‘FOUR IN A ROW’ against each other. The codes can be in the following languages: 1. C 2. C++ 3. Java 4. PythonNote: In the entire documentation, ‘user’ refers to the team and ‘admin’ refers to theadministrator. A part of the code will be submitted by the user and the rest will be created
by the admin to help simulate and execute the entire game. The position of the diskspresent in frame will be given as integers (completely explained in the format of board.txtfile later in this document).Game Explanation:The game is a modified version of connect 4.The only difference is the extra 4 types ofspecial disk. 1. Clear row 2. Clear column 3. Clear first neighbours 4. Dual colour 1.) Clear row: A self-destructing disk which will first go to the lower-most unoccupied place available in the selected column and will destroy each and every disk in that row including itself. 2.) Clear column: A self-destructing disk which will first go to the lower-most unoccupied place available in the selected column and will destroy each and every disk in that column including itself. 3.) Clear first neighbours: A self-destructing disk which will first go to the lower-most unoccupied place available in the selected column and will destroy each and every first neighbour disk in that row including itself. e.g. if the Clear first neighbours disk is used with the 4th column selected and suppose 11 (see fig. below) is the lowest unoccupied position then it will destroy the disks at 17,10,3,4,5,12 and 19 if they are present and after that the disk will destroy itself. 4.) Dual colour: This is the NEUTRAL disk. It will support both the colours.NOTE: Both teams will have all the 4 powers total but can use only once in a set anytimeduring the set but the DUAL COLOUR DISK must be used in the first ten turns of the teamelse the move will be consider illegal. Except the dual colour power, using the rest of thethree powers is not a compulsion.User Task:The user has to make a program named <Teamid>.<file_extension>. Suppose the Team Id ofa particular team is Co0023, then the program name should be Co0023.cpp or Co0023.javaas the case may be. This program made by user will represent his decision at a particularstage of the game. The codes will have to produce the output.txt file when they are called.The first integer stands for the type of disk they want to use and the other integer stand forindicating the column in which the team wish to place their disc.
The numbers are in the same order as the spaces in the board.txt file i.e. 1 for the leftmostcolumn and 7 for the rightmost column.Text Files:To guide the user the entire course of game being played, he will be provided with sometext files. Below is the description of them:team_no.txt: This text file will show the team number (1 or 2). The code has to read itsteam no. from this file for playing.board.txt: This text file will show the positions of the discs already placed in the frame andthe places which are still blank. This file will be having 42 integers separate d by blankspaces.0 – Indicates that the place is unoccupied.1 – Indicates that team number 1 got its disc there.2 – Indicates that the team number 2 got its disc there.12 – Indicates that the dual colour block is present there.The 42 integers in the file will be for their position on board as shown in fig.
output.txt: This is the file which the user’s code has to produce to tell their decision to theadmin about their next move.The team’s code output will be 2 integers in this text file. First integer to choose the type ofdisk they want to use and the second integer to choose the column in which they want toplace their disk.The range of the First integer is from 1-51-Clear row disk2-Clear column disk3-Clear first neighbours disk4-Dual colour disk5-Normal diskThe range of Second integer is 1-71 For the leftmost column and 7 for the rightmost columnApart from these a team can create its own help file for analysing opponent’s gameplay ordeciding their gameplay but not more than 5 files at a time.Editable permissions to files:All the files are not both readable and writable. The permissions goes as follows: 1. team_no.txt: only readable 2. board.txt: only readable. 3. output.txt: readable and writable. The team has to write or return its decision in this file only.The above files will be made by the administrator and will be in the same folder as the mainprogram of the team. So, the teams can directly use the names of these files in their codes.The help files will be made by the teams only for their own convenience itself. These filescan either be in the current folder or can be inside a new sub-directory created by the teamin the current folder. Teams should create their help files (if needed) with names startingwith their team id. For example Co0012.txt so that it can be seen which file is created bywhich team code and also this is to avoid common help file names of 2 codes resulting inboth editing the same file.
Game simulation: 1. The admin program will call team programs and provide them the required information in the text files. The teams have to access the input files and their help files and based on the data in those files, they have to decide their next move which will be given back to the admin in the text file output.txt. The admin will update the admin text files (i.e. board.txt etc) using this data and so the game goes on. Whenever the code of a particular team is called, the only information team has, is the input and his helper files.2.Game will be held in 3 rounds:ROUND 1 – Teams will be divided in random groups of two i.e. their opponent will bechosen on the spot (randomly, no preferences). Teams will play game with their opponentand the winner will be qualified to the round 2.In a game of round 1 there will be 3 sets. The winner gets 2 points per set and if there is adraw both teams get 1 point each. If after 3 sets both team got equal points then game willbe continued to best of 5. If we don’t get a winner in 5 sets then opponent will be changed.Round 2 – Participants will be divided in 2 groups and games will be played with teamswithin same group. Each team will get a chance to play with every team present in samegroup. Beating an opponent will award you 2 pts. Game will be played in same manner as inround 1 but this time if we don’t get a winner after 5th set then both teams will get 1 point.On the basis of total number of points a team get, 6 teams (3 teams from each group) willbe selected for round 3(finals).Every participant reaching ROUND 2 will be awarded with Certificate of Participation.Round 3 (Final) – Each team will get to play with every other team and collects 2 points perwin and 1 point per draw. Top 3 scorers will be selected as 1st, 2nd and 3rd.In case there is a tie between any two teams at any place selecting top 6 or top 3 then thetie breaker rules will be applied. 1) Golden set rule – The two teams will play sets until one of them wins a set i.e. they play a set ,if one of them win then we get a winner else another set will be played. This will be continued till 10 games at max. If still we don’t get a winner then the bad beat rule will be applied. 2) Bad beat rule – Randomly any other entry will be chosen to play with these two teams and sets will be played. One who wins more sets against that common opponent wins.
Every team reaching the Round 3 will be awarded with Certificate Of Excellence.The top 3 teams will be given the Prizes along with the Certificate Of Excellence.The game will be displayed on a graphical connect 4 interface.In the first set of any game first turn will be decided randomly and after that teams will getfirst turn alternatively.At any stage if any code outputs any illegal output (column which is full , column except 1 to7 ,try to use a power twice or don’t use the dual colour disk within first 10 turns) or fails torespond in limit execution time(2 sec) then it will be called for 2 more times, if still it fails togive an appropriate output then it will be considered as a quit. The opponent will beconsidered as winner of that set.INSTRUCTIONS:Rules, Tips and Instructions 1. The competition is open to all (NSITians as well as outsiders) but participants must be students of any college .No professionals or school students are allowed. The codes should be in following languages only: 1. C 2. C++ 3. Java 4. Python 2. The decision of the organizing team shall be regarded as final in case of any discrepancy. 3. A single file has to be submitted containing the source code. Text files will be created only during the game play. 4. Text files are an aid to the teams as the teams can guess the tactics of their opponents by judging their moves. 5. The maximum number of text files a team can make is 5. 6. Time the code of a particular team should take should be realistic, mostly less than 2 second. 7. Clever programming will surely have an upper edge over others. 8. Note that at any point of time the latest information will be that which is on the site. The information provided in the pdf downloaded earlier may not be the latest. However, registered participants will be informed through mail about any changes on the site. 9. Any team found interfering with admin text files or opponent help files will be directly disqualified.
10. At least one member of the team should be present at the event day. Participants who won’t be able to come to N.S.I.T. on the event day should send an email with a serious cause and no one is responsible if their code works improperly on the event day. They will be directly disqualified. 11. After every round the teams qualifying for the next round will be given time to make changes in their program if they want to make some. No team will be allowed to change or edit their program once they submitted their program for the next round (except the first round). 12. In round 1 only if any team’s code failed to work (execution time exceeded or illegal output) then they will be given a chance to edit their program and their game will be played at the ending of the round. 13. Teams have to submit single source file with name as its team id. No exe file will be accepted.Certificate Policy:Top 6 teams will be given the certificate of excellence.Top 3 teams will be give prizes along with the certificate of excellence.Teams clearing the first round will be given the participation certificate.Team Specifications:The participating entries must be in a team of a maximum of 3 [three] people of samecollege. If the participating team feels that they require more participants, they can forwardtheir request, with suitable reasons.TIMELINE:The teams (maximum of three members) have to start preparing the code and they willhave to submit the final code in proper format on 16th February, 2012.At least one member from each team should be present at the time of simulation of theteams code during the festival i.e. 18th to 19th February, 2012.Teams will have to submit their final code till 16th February. The codes will be compiled andtested after linking them with the admin program so to ensure that they works perfectlywith the admin code . Teams will be reported with the problems faced if any.The event will be in 3 rounds. Round 1 will be played on day 1 (18 th ) and the other tworounds will be played on day 2(19th).
RESOURCES:For a basic idea about the normal connect 4 game.http://en.wikipedia.org/wiki/Connect_FourIf u want to give the basic connect 4 a tryhttp://www.mathsisfun.com/games/connect4.htmlhttp://www.bigmoneyarcade.com/?action=playgame&gameid=46http://www.roughoat.com/games/flash/connect4.htmlNOTE : The event game is different from the basic connect 4 game there will be extrapowers in the event game ….CONTACT US:For further queries contact us Contact No. Maid IdAnkit Gupta +91-9990682023 firstname.lastname@example.orgVishal Singh +91-9891664844 email@example.comArchit Goel +91-9716530201 firstname.lastname@example.orgSaurabh Modi +91-9818249480 email@example.com