CS 242 Spring 2012 : Assignment 1.3
CS 242 Spring 2012 : Assignment 1.3
This page last changed on Feb 20, 2012 by cemeyer2.
During the Middle Ages, there were two feudal kingdoms which bordered one upon the other. One kingdom was ruled by Ethelred the Great; the other by Aelfric the Barbaric. Raids between the two kingdoms were frequent and often savage. The bloodiest part of each kingdom was the border area which was claimed by both kings. Both had tried unsuccessfully to gain possession of this disputed territory as had their ancestors before them. Many schemes had been tried and had failed.
One day Aelfric decided that the only way to end the dispute was to seize the castle of Ethelred the Great and thus win not only the disputed territory, but also Ethelred’s entire kingdom. He and his son, Prince Alfred, gathered their forces and called upon Duke Athelstan to join them. Athelstan held a castle fief which meant that in order to hold his fief he was obligated to defend the king’s castle and also to help him wage war. With his forces and Duke Athelstan’s help, Aelfric hoped to conquer Ethelred’s kingdom and also to protect his own castle while he was waging war.
About this same time, King Ethelred also came to the conclusion that the only way to gain control of the disputed territory was to conquer the neighboring kingdom. Gathering his forces, he called upon his son, Prince Edgar, and his brother, Duke Ethelbert, to help command them. Leaving some of his men to guard his castle from possible attack, Ethelred set out to wage war against Aelfric the Barbaric. This is the point at which the FEUDAL war begins, with both Kings preparing to invade the neighboring kingdom.
The object of Feudal is to invade and capture the opponent’s Castle or slay his royalty – King, Prince and Duke – while strategically protecting your own Castle and royalty.
For this assignment, you will be implementing the two player version of Feudal, building on your chess solving application. To start, you need to make a board to play on. Here is what the original Feudal board looked like:
Impassable mountains are in dark green and the striped squares indicate rough terrain (which the faster-moving mounted pieces may not cross). Each player receives 2 adjacent quadrants of the board.
A coin is tossed to determine who will position the playing board and who will move first. Player winning the toss will be first to move; player losing the toss positions the board, choosing any two adjacent quarters as his kingdom. After board is positioned, players secretly deploys (positions) their playing pieces in their kingdoms.
Two players use only two of the six sets of playing pieces – one selects a blue set, the other a brown set. After sorting his pieces, each player will have the following:
MOUNTAINS AND ROUGH TERRAIN (solid green and patterned spaces respectively) are restricted areas of play. Before deploying their forces, players should check rules for Mounted Men and Footmen for restrictions regarding positioning
CASTLE piece may be placed on any terrain, including rough and mountainous areas. Once positioned, the Castle may not be moved. The Castle Green is the only entrance to or exit from the Castle (which you can determine which direction that faces as the castle is 1×2, so long as it is consistent).
MOUNTED MEN (on horses) may not be positioned on, move onto or across mountains or rough terrain; but, they may cross valleys between mountains and/or rough terrain.
FOOTMEN may not be positioned on, move onto or across mountains. They may, however, cross rough terrain and valleys between mountains. Archers and Squires are the only pieces that may not be positioned in (or enter) their own Castles; however, they may be placed or moved onto the Castle Green of either side.
The play begins with the player who won the toss moving first. During his turn, each player may move any or all of his men; at least one man must be moved in each turn. Each piece is allowed only one move per turn and may be moved only as diagrammed below. All men (except Squire) may be moved only over unoccupied spaces; Squire’s move, same as knight in chess, may be over vacant or occupied spaces (but not over Castle piece). When moving to slay an enemy, the attacker (except Archer) must move onto an enemy-occupied space; slain enemy is removed from board and victor occupies the space.
Archers do not “move” to slay; instead, they may shoot (remove) the first man in line of fire up to three spaces away in any direction. They may not shoot over mountains or Castles; however, they may shoot from or across the Castle Green. To cross the Green, or to leave or enter the Castle, a man must stop on the Castle Green and wait till his next turn to leave it. Note that the Squire’s move makes it impossible for him to enter the enemy’s Castle from the Green. The game ends when the opponent’s Castle is captured, or when all of his royalty has been slain. To capture a Castle, the invader must gain entrance through, and stop on the Castle Green. From the Green he may enter the Castle on his next move – and WIN THE GAME!
All moves (except Squire’s) are made over unoccupied spaces. To slay, attacker (except Archer) must end a move on an enemy-occupied space. No man may move onto or across a mountain.
For this week, your job is to implement the basic Feudal board game and write a basic solver for it. You need to do the following:
material on this page borrowed from various sources across the interwebs, found using wifis and ethernets, traversing through tubes:
|Document generated by Confluence on Mar 29, 2012 02:55|