Skip to content

Commit 5334333

Browse files
authored
Merge pull request #331 from softwareconstruction240/passoff-examples
Passoff examples
2 parents 03c343c + 1bfe58d commit 5334333

3 files changed

Lines changed: 30 additions & 4 deletions

File tree

chess/5-pregame/pregame.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ All of the tests in your project must succeed in order to complete this phase.
171171

172172
To pass off this assignment, first submit your work to the course [auto-grading](https://cs240.click/) tool. Once it completely passes the autograder, meet with a TA and demonstrate that your Chess client and server meet all requirements and they will assign you a final grade.
173173

174+
#### Passoff Common Problems
175+
176+
Before coming to passoff with a TA, check to make sure your code functions properly and doesn't have any of these common problems past students have had. [Phase 5 Passoff Common Problems](../../instruction/chess-tips/chess-tips.md#passoff-frequently-encountered-problems)
177+
174178
### Grading Rubric
175179

176180
> [!NOTE]

chess/6-gameplay/gameplay.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ All of the tests in your project must succeed in order to complete this phase.
239239

240240
To pass off this assignment submit your work to the course [auto-grading](https://cs240.click/) tool. When that is done, meet with a TA and demonstrate that your Chess client and server meet all requirements and assign you a final grade.
241241

242+
#### Passoff Common Problems
243+
244+
Before coming to passoff with a TA, check to make sure your code functions properly and doesn't have any of these common problems past students have had. [Phase 6 Passoff Common Problems](../../instruction/chess-tips/chess-tips.md#passoff-frequently-encountered-problems-1)
245+
242246
### Grading Rubric
243247

244248
> [!NOTE]

instruction/chess-tips/chess-tips.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you turn in your code without enough commits, the autograder will let you kno
1717

1818
## These collections look identical to each other, but Java says they aren’t
1919

20-
Look at the [specification](https://github.com/softwareconstruction240/softwareconstruction/blob/main/chess/0-chess-moves/chess-moves.md#object-overrides) for mentions of the `equals()` and `hashCode()` methods. It might also be worthwhile to implement a `toString()` method. Additionally, check the promotion piece (null in 99% of cases). Also, review the getters and setters for each class if that doesn’t work.
20+
Look at the [specification](../../chess/0-chess-moves/chess-moves.md#object-overrides) for mentions of the `equals()` and `hashCode()` methods. It might also be worthwhile to implement a `toString()` method. Additionally, check the promotion piece (null in 99% of cases). Also, review the getters and setters for each class if that doesn’t work.
2121

2222
## JUnit - No test events received
2323

@@ -45,11 +45,11 @@ If your IDE is telling you to use static, you probably should change your code t
4545

4646
## Clone and Copy
4747

48-
When in your `ChessGame.validMoves`, you may want to create a copy/clone of the ChessBoard so that you can make a piece move and see if you are still in check to know if that is a valid move or not. If you create a shallow copy, the ChessBoard will be the exact same, and will keep any changes you make. This needs to be a DeepCopy or clone so that it can be unique and different, so that if a chance happens on one instance, the other will stay the same. If you would like some explanations on how to incorporate clone and copy, look here for [copying objects](https://github.com/softwareconstruction240/softwareconstruction/wiki/Copying-Objects). One such method is to have ChessBoard implement Cloneable, then in the override clone method, you loop through the 2d ChessPiece array, and do `Arrays.copyOf` to copy the chess board row by row, then finally putting the 2d array into the cloned ChessBoard.
48+
When in your `ChessGame.validMoves`, you may want to create a copy/clone of the ChessBoard so that you can make a piece move and see if you are still in check to know if that is a valid move or not. If you create a shallow copy, the ChessBoard will be the exact same, and will keep any changes you make. This needs to be a DeepCopy or clone so that it can be unique and different, so that if a chance happens on one instance, the other will stay the same. If you would like some explanations on how to incorporate clone and copy, look here for [copying objects](../copying-objects/copying-objects.md). One such method is to have ChessBoard implement Cloneable, then in the override clone method, you loop through the 2d ChessPiece array, and do `Arrays.copyOf` to copy the chess board row by row, then finally putting the 2d array into the cloned ChessBoard.
4949

5050
## `==` vs `.equals()` comparison
5151

52-
If you are trying to see if a king is in check by doing `endPosition == kingPosition`, the answer will always return false. Instead, you should use `endPosition.equals(kingPosition)`. To understand why Objects require `.equals()` instead, please refer to [Java Object Class](https://github.com/softwareconstruction240/softwareconstruction/wiki/Java-Object-Class#equals).
52+
If you are trying to see if a king is in check by doing `endPosition == kingPosition`, the answer will always return false. Instead, you should use `endPosition.equals(kingPosition)`. To understand why Objects require `.equals()` instead, please refer to [Java Object Class](../java-object-class/java-object-class.md).
5353

5454
## I don't have enough GitHub commits to pass the autograder
5555

@@ -182,7 +182,7 @@ You probably made the move calculator a class variable inside ChessPiece. Remove
182182

183183
## Access denied to database chess or Access denied for user ‘dbUser173910573’@’%’ to database ‘chess’
184184

185-
This means they hardcoded the database to chess. Or they need to call createDatabase. Look here for more debugging tips: https://github.com/softwareconstruction240/softwareconstruction/blob/main/chess/4-database/database.md#pass-off-submission-and-grading
185+
This means they hardcoded the database to chess. Or they need to call createDatabase. Look here for more information: [Ititializing Your Database and Tables](../../chess/4-database/database.md#initializing-your-database-and-tables)
186186

187187
## No driver provided error
188188

@@ -233,6 +233,15 @@ If it says “Error: Unauthorized” with a 401 error, that probably means that
233233

234234
Your ServerFacade is probably not in a package. Put it in a package (probably not your UI package, is it a UI class?) and you should be able to import it
235235

236+
## Passoff Frequently Encountered Problems
237+
238+
Here are a couple of things that students commonly forget to include as part of their code which causes them to fail their passoff. This is not a complete list of everything that your code needs to do in order to pass, just some of the common problems.
239+
240+
- After registering, you will automatically enter the signed-in state, you don't need to login afterwards. [Prelogin UI Command Descriptions](../../chess/5-pregame/pregame.md#prelogin-ui)
241+
- Make your ListGames numbering be independent of the game IDs. [Postlogin UI Command Descriptions](../../chess/5-pregame/pregame.md#postlogin-ui)
242+
- Make sure your board is printed correctly! [Gameplay UI Description](../../chess/5-pregame/pregame.md#gameplay-ui)
243+
- Print readable errors and make sure your code doesn't crash. For example, make sure you handle trying to join or observe a game with an invalid game number input (`1000`, `-10`, `two`). [UI Requirements](../../chess/5-pregame/pregame.md#ui-requirements)
244+
236245
## I don't have enough GitHub commits to pass the autograder
237246

238247
See [previous](/instruction/chess-tips/chess-tips.md#General---all-phases)
@@ -267,6 +276,15 @@ This could be from a race condition, if you send a notification that a move was
267276

268277
This exception is thrown when you are trying to send a message to a closed channel. Have the student make sure they are checking that the session is open (session.isOpen()) before sending it a message.
269278

279+
## Passoff Frequently Encountered Problems
280+
281+
Here are a couple of things that students commonly forget to include as part of their code which causes them to fail their passoff. This is not a complete list of everything that your code needs to do in order to pass, just some of the common problems.
282+
283+
- Resigning should require a confirmation, and does **not** kick players from the game. [Gameplay Functionality](../../chess/6-gameplay/gameplay.md#gameplay-functionality)
284+
- Anyone can highlight any piece, independent of whose turn it is. In addition, a user trying to highlight a position with no piece shouldn't break your code. [Gameplay Functionality](../../chess/6-gameplay/gameplay.md#gameplay-functionality)
285+
- Make sure you implement pawn promotion. [Pawn Functionality](../../chess/0-chess-moves/the-game-of-chess.md#pawn)
286+
- All messages should contain player usernames. Move messages should have a description of the move such as a2 to a4. [Notifications](../../chess/6-gameplay/gameplay.md#notifications)
287+
270288
## I don't have enough GitHub commits to pass the autograder
271289

272290
See [previous](/instruction/chess-tips/chess-tips.md#General---all-phases)

0 commit comments

Comments
 (0)