Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerwingxys committed Feb 16, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent add8b61 commit 3a627d3
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/signpost/Model.java
Original file line number Diff line number Diff line change
@@ -94,22 +94,6 @@ class Model implements Iterable<Model.Sq> {
// puzzle-generation software is complete.
// FIXME: Remove everything down to and including
// "// END DUMMY SETUP".
// _board = new Sq[][] {
// { new Sq(0, 0, 0, false, 2, -1), new Sq(0, 1, 0, false, 2, -1),
// new Sq(0, 2, 0, false, 4, -1), new Sq(0, 3, 1, true, 2, 0) },
// { new Sq(1, 0, 0, false, 2, -1), new Sq(1, 1, 0, false, 2, -1),
// new Sq(1, 2, 0, false, 6, -1), new Sq(1, 3, 0, false, 2, -1) },
// { new Sq(2, 0, 0, false, 6, -1), new Sq(2, 1, 0, false, 2, -1),
// new Sq(2, 2, 0, false, 6, -1), new Sq(2, 3, 0, false, 2, -1) },
// { new Sq(3, 0, 16, true, 0, 0), new Sq(3, 1, 0, false, 5, -1),
// new Sq(3, 2, 0, false, 6, -1), new Sq(3, 3, 0, false, 4, -1) }
// };
// for (Sq[] col: _board) {
// for (Sq sq : col) {
// _allSquares.add(sq);
// }
// }
// END DUMMY SETUP

// FIXME: Initialize _board so that _board[x][y] contains the Sq object
// representing the contents at cell (x, y), _allSquares
@@ -592,12 +576,9 @@ boolean connectable(Sq s1) {
if(direction()==0 || direction() != pl.dirOf(s1.pl)){
return false;
}
if(s1.predecessor() != null || successor() != null ){
if(s1.predecessor() != null || successor() != null ||s1.sequenceNum() == 1 || sequenceNum()==width()*height()){
return false;
}
// if( s1.group()>=0 && s1.head() != s1){//??????
// return false;
// }
if( this.sequenceNum()>0 && s1.sequenceNum()>0 && this.sequenceNum() != s1.sequenceNum()-1){
return false;
}
@@ -606,9 +587,6 @@ boolean connectable(Sq s1) {
return false;
}
}
if( s1.sequenceNum() == 1 || sequenceNum()==width()*height()){
return false;
}
return true;
}

0 comments on commit 3a627d3

Please sign in to comment.