From 22797be579e6a260f2be52bcf0ba3c55dca818a4 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 19 Dec 2022 22:29:04 -0500 Subject: [PATCH] Fixed movement on a pieces and user input --- src/chess/King.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chess/King.java b/src/chess/King.java index 486ec09..eeb1369 100644 --- a/src/chess/King.java +++ b/src/chess/King.java @@ -54,9 +54,10 @@ public class King extends ChessPiece { private void castleRight(){ // casting has to move the rook on the right size of the king from white's perspective - if (this.isWhite) { - b.set(b.size() - 3, 0, b.get(b.size() - 1, 0)); - } else + if (this.isWhite) + b.movePiece(b.size() - 1, 0, b.size() - 3, 0); + else + b.movePiece(b.size()-1, b.size()-1, b.size()-3, b.size()-1) b.set(b.size()-3, b.size()-1, b.get(b.size()-1, b.size()-1)); }