public:t-622-arti-11-1:program_2
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | public:t-622-arti-11-1:program_2 [2011/03/11 11:43] – angelo | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Programming Assignment 2: Game Playing ====== | ||
+ | |||
+ | **Weight:** 5%\\ | ||
+ | **Due:** Thursday, March 3rd, by 23:59\\ | ||
+ | **Group Size:** 1-3\\ | ||
+ | **Programming Language:** The skeleton is in Java, but you can do this in any language\\ | ||
+ | **Provided skeleton:** {{: | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Having the computer play a game with a human player has always been an attractive way to showcase artificial intelligence, | ||
+ | |||
+ | This is an assignment where you get the opportunity to write a game playing agent. The game is the classic **" | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | * You will start with a skeleton program in Java. This program won't run until you have filled in some of the basic game playing methods, but you'll find special **TODO** markers in the code to guide you through the process. | ||
+ | * In essence, you need to focus on the **State** class to begin with, in order to provide some of the crucial game playing information about each state (e.g. the successor function, what moves are available and which player has the turn) and a mechanism to change the state through a move. Notice that a move is simply indicating the column you want to drop a piece into, so at any given time you have 7 possible moves (unless a column is full). | ||
+ | * A **Search** class is also provided to find the best move, but currently it picks a move randomly, so this is a class you'll need to refine and (at least) have it perform a proper search for a move that should lead to a future good state. This is where you have total freedom of approach! | ||
+ | * The **State** class contains an evaluation function. This is used by the search algorithm when the maximum depth has been reached, then the leaves are evaluated with this function. The current implementation that you are given is sufficient to play the game once you have the other parts of the State and the Search classes. It evaluates terminal states correctly, but all intermediate states have a neutral evaluation (meaning it is considered favorable for neither player). It is your job to fill in the code for evaluating intermediate states more intelligently. | ||
+ | * To test your game playing agent, you'll of course play against it yourself, but once all the assignments will be turned in, we'll have a **tournament** between your agents! | ||
+ | * In order to participate, | ||
+ | |||
+ | ===== What To Turn In ===== | ||
+ | |||
+ | Submit a single **zip** or **rar** file into MySchool with all the required code in order to run your game playing agent. Include a **readme.txt** explaining how to run it (NOTE: this is important if you're not using the Java skeleton). Remember to document your code! In particular, parts where you implemented something clever :-) | ||
+ | |||
+ | Be also prepared to have your agent competing against other agents in the tournament! Make sure you're using the standard stdin/ | ||
+ | |||
+ | |||
+ | ===== Running the code ===== | ||
+ | |||
+ | The provided skeleton does not compile as it is. You need to fill in, at least, **TODOs** in the file **State.java**, | ||
+ | |||
+ | **NOTE**: all interactions with the program are through the command line. The window displaying the board is only for showing the current state, you can't interact with it (i.e. select moves). | ||
+ | |||
+ | |||
+ | ===== The command line interface ===== | ||
+ | |||
+ | The **command line** interface is very simple. A prompt is indicated by **">" | ||
+ | |||
+ | If you want to implement your agent using a different language, you are completely free to do that, as long as you inform us (Hannes or Angelo) about the specific language you plan to use. If you do this, your program must use **stdin** and **stdout** as input/ | ||
+ | |||
+ | The output of the program only matters in three cases. | ||
+ | |||
+ | - When the user is expected to enter something, the prompt line must start with **">" | ||
+ | - When the **" | ||
+ | - When the **" | ||
+ | * The first character should be either **" | ||
+ | * The following characters should represent the squares on the board, each one being **" | ||
+ | * The example below shows the line printed for the state in the picture above: | ||
+ | < | ||
+ | > p | ||
+ | BBBBRBB.RBBB...RBBR...RRR....BRR....RR..... | ||
+ | </ | ||
+ | |||
+ | If you don't use the Java skeleton as a base, make sure you also flush the standard output every time you display the prompt. | ||
+ | |||
+ | ====== Tournament ====== | ||
+ | |||
+ | ===== Teams ===== | ||
+ | |||
+ | ^#^**Team Name**^**Member 1**^**Member 2**^**Member 3**^**Language**^ | ||
+ | |1|Finnur|Finnur Emil Björgvinsson| | |Java| | ||
+ | |2|Helgi|Helgi Siemsen Sigurðarson| | |Java| | ||
+ | |3|Team Dragon|Þorsteinn Þorvaldsson| | |Java| | ||
+ | |4|Leifsson|Helgi Leifsson| | |Java| | ||
+ | |5|Mask|Magnús Ágúst Skúlason| | |C| | ||
+ | |6|Kim|Kim Kraft| | |Java| | ||
+ | |7|Abalpet|Árni Steingrímur Sigurðsson|Baldur Blöndal|Pétur Ólafur Aðalgeirsson|Java| | ||
+ | |8|Ricky Bobby|Eiríkur Fannar Torfason|Grímur Tómas Tómasson| |C++| | ||
+ | |9|AHJ|Ásgeir Jónasson|Hrafn Jökull Geirsson|Jökull Jóhannsson|Java| | ||
+ | |10|Sindri|Sindri Bjarnason| | |Java| | ||
+ | |11|Italian Team|Carmine Oliva|Lorenzo Scagnetti|Niccolo Drum Rossetti|Java| | ||
+ | |12|Gunjon|Gunnar S Sigurbjörnsson|Jón Friðrik Sigurðarson| |Java| | ||
+ | |13|Thorgeir|Þorgeir Karlsson| | |Java| | ||
+ | |14|Gudelin|Elín Carstensdóttir|Guðrún Hauksdóttir| |Java| | ||
+ | |15|Krist|Kristján Tryggvason| | |Java| | ||
+ | |16|Sigurdur|Sigurður Jökull Eydal Tómasson| | |C#| | ||
+ | |||
+ | ===== Matches ===== | ||
+ | |||
/var/www/cadia.ru.is/wiki/data/pages/public/t-622-arti-11-1/program_2.txt · Last modified: 2024/04/29 13:33 by 127.0.0.1