Skip links
Drag

Java代写|Board Game Lab 2

这是一个加拿大的作业案例分享,主要内容为Lab棋盘游戏java代写

2 Getting Started

In this lab, we use the latest Eclipse (2021-12 build):https://www.eclipse.org/downloads/packages/release/
2021-12/r/eclipse-ide-java-developers

Go to the course eClass page for your section. Under Lab 2, download the file EECS3311 Lab2.zip which
contains the starter project for this lab.

• Unzip the file, and you should see a directory named eecs3311-lab2. It’ s a Eclipse project.
• You can import this project into your Eclipse as an General Java project.

• The start project should have the following structure and on default does compile.

Description

This lab’s major learning goal is applying object oriented design in Java and understand the applicable design
patterns. In this lab, you will be:

• Designing basic classes
• Ensuring classes are small and do one thing (Single Responsibility Principle)
• Creating class abstractions (Dependency Inversion)
• Using inheritance, composition, and polymorphism
• Identify design patterns

We will be encoding the Three Musketeers Board game. Feel free to play against an AI to gain some intuition about
this game.

THE GAME

This game is played on a 5×5 square board with this starting position:
• Starting Position:

RULES

• TURNS – The Musketeers always go first. Each player makes one move before passing to their opponent.
MUSKETEER – On the Musketeers’ turn, a musketeer can move to an adjacent orthogonal (neighboring,
non-diagonal) cell occupied by a guard, capturing it and occupying that cell.

• GUARD – On the Guards’ turn, a guard can move to an adjacent orthogonal empty cell.

• GOALS

– The Musketeers win if they cannot capture any guards AND if they are not on the same row or column.
– The guards win if all the musketeers are on the same row or column at any point in the game.