Skip to content

Commit

Permalink
Merge pull request #751 from B-McCusker56/binary
Browse files Browse the repository at this point in the history
All user board interactions fiex to be correct
  • Loading branch information
B-McCusker56 authored Mar 12, 2024
2 parents 05802d7 + 1f5fd80 commit 6fbbccd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
22 changes: 12 additions & 10 deletions puzzles files/binary/6x6 easy/876868768
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
<puzzle name="Binary">
<board height="6" width="6">
<cells>
<cell value="1" x="0" y="0"/>
<cell value="1" x="1" y="0"/>
<cell value="1" x="2" y="0"/>
<cell value="1" x="3" y="0"/>
<cell value="1" x="4" y="0"/>
<cell value="1" x="5" y="0"/>
<cell value="1" x="0" y="5"/>
<cell value="0" x="3" y="5"/>
<cell value="0" x="2" y="4"/>
<cell value="0" x="3" y="4"/>
<cell value="1" x="5" y="4"/>
<cell value="0" x="1" y="3"/>
<cell value="0" x="2" y="3"/>
<cell value="1" x="5" y="3"/>
<cell value="0" x="0" y="1"/>
<cell value="0" x="1" y="1"/>
<cell value="0" x="2" y="1"/>
<cell value="0" x="3" y="1"/>
<cell value="0" x="4" y="1"/>
<cell value="0" x="5" y="1"/>
<cell value="1" x="3" y="1"/>
<cell value="1" x="1" y="0"/>
<cell value="0" x="4" y="0"/>
<cell value="0" x="5" y="0"/>
</cells>
</board>
</puzzle>
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/edu/rpi/legup/puzzle/binary/BinaryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ public void changeCell(MouseEvent e, PuzzleElement data) {
this.boardView.getSelectionPopupMenu().show(boardView, this.boardView.getCanvas().getX() + e.getX(), this.boardView.getCanvas().getY() + e.getY());
}
else {
if (cell.getData() == -2) {
data.setData(0);
if (cell.getData() == 0) {
data.setData(1);
}
else {
if (cell.getData() == 0) {
data.setData(-1);
if (cell.getData() == 1) {
data.setData(2);
}
else {
data.setData(-2);
data.setData(0);
}
}
}
}
else {
if (e.getButton() == MouseEvent.BUTTON3) {
if (cell.getData() == -2) {
data.setData(-1);
if (cell.getData() == 0) {
data.setData(1);
}
else {
if (cell.getData() == 0) {
data.setData(-2);
if (cell.getData() == 1) {
data.setData(2);
}
else {
data.setData(0);
Expand Down

0 comments on commit 6fbbccd

Please sign in to comment.