ECS170 – Connect 4 World Championship
Introduction & Assignment
In this assignment, you’ll write a computer program to play the classic game Connect Four. This
is a great way to practice the minimax and heuristic algorithms we’ve covered in class.
Copyright By PowCoder代写 加微信 powcoder
Connect Four is a tic-tac-toe variant played on a grid. Players alternate turns dropping coins
into one of the seven different columns. Unlike tic-tac-toe, Connect Four worlds are affected
by gravity and you may only place coins at the lowest possible positions in each column. In
other words, moves in Connect Four are made by dropping the coins into the columns, rather
than placing them into specific squares.
As the name implies, the goal of Connect Four is to get four of your colored coins in a row,
either horizontally, diagonally, or vertically. The first player to do so wins. If all locations are
filled without a player getting four in a row, the game is a draw.
Connect Four is known to be biased in favor of the first player, so when testing your AI
make sure that you have it play as both the first and second player. A decent Al program will
never lose as the first player, and a good Al program will be able to win as the second.
Instructions
As with PathFinder, we’ve provided you with a good amount of starter code to handle most of
the complicated setup. The provided starter code is a working Connect Four engine that
allows you to mix and match human and computer opponents using the command line. Your
assignment is to create an instance of the AlModule class that plays Connect Four. To do so,
you’ll need to familiarize yourself a bit with the connect4 and AlModule classes.
Because even a simple minimax player can play perfectly given unlimited time, in this
assignment part of your task will be to create a player that can work in limited time
conditions. During gameplay, your player will have to select a move within 500 milliseconds.
To ensure fairness, we will be testing these games on the CSIF machines. To learn how to
remote into the CSIF machines, check out this resource. Take a look at randomAl and
stupidAl to get an idea of how to assign a move.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com