-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from shankar-veludandi/new_puzzle-skyscrapers
push
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveTooFewContradictionRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package edu.rpi.legup.puzzle.skyscrapers.rules; | ||
|
||
import edu.rpi.legup.model.gameboard.Board; | ||
import edu.rpi.legup.model.gameboard.CaseBoard; | ||
import edu.rpi.legup.model.gameboard.PuzzleElement; | ||
import edu.rpi.legup.model.rules.ContradictionRule; | ||
import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard; | ||
import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell; | ||
import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersClue; | ||
import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType; | ||
|
||
import java.awt.*; | ||
import java.util.*; | ||
import java.util.List; | ||
|
||
public class PreemptiveTooFewContradictionRule extends ContradictionRule{ | ||
|
||
public PreemptiveTooFewContradictionRule() { | ||
super("SKYS-CONT-0006", "Preemptive Too Few", | ||
"Less skyscrapers are visible than there should be in an incomplete row/col", | ||
"edu/rpi/legup/images/skyscrapers/contradictions/TooFew.png"); | ||
} | ||
|
||
@Override | ||
public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { | ||
SkyscrapersCell cell = (SkyscrapersCell) puzzleElement; | ||
SkyscrapersBoard skyscrapersboard = (SkyscrapersBoard) board; | ||
Point loc = cell.getLocation(); | ||
|
||
//get borders | ||
int west = skyscrapersboard.getWestClues().get(loc.y).getData(); | ||
int east = skyscrapersboard.getEastClues().get(loc.y).getData(); | ||
int north = skyscrapersboard.getNorthClues().get(loc.x).getData(); | ||
int south = skyscrapersboard.getSouthClues().get(loc.x).getData(); | ||
|
||
|
||
|
||
InsufficientVisibilityContradictionRule tooFew = new InsufficientVisibilityContradictionRule(); | ||
CellForNumberCaseRule caseRule = new CellForNumberCaseRule(); | ||
System.out.println("1"); | ||
|
||
|
||
//Check Row | ||
|
||
|
||
//check west | ||
|
||
|
||
//create board with every possible row permutation given the current cell | ||
|
||
System.out.println("2"); | ||
List<Board> list = caseRule.getCasesFor(board, skyscrapersBoard.getWestClues().get(loc.y), 1); | ||
|
||
|
||
|
||
// for(int i = 0; i < list.size(); i++) | ||
// System.out.println(list.get(i)); | ||
|
||
System.out.println("3"); | ||
|
||
|
||
|
||
|
||
//for each row call getCasesFor for each number progressively | ||
//getCasesFor for each clue | ||
|
||
//for each clue iterate 1-n for number | ||
|
||
// | ||
return null; | ||
|
||
|
||
} | ||
|
||
|
||
|
||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveTooManyContradictionRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package edu.rpi.legup.puzzle.skyscrapers.rules; | ||
|
||
public class PreemptiveTooManyContradictionRule { | ||
} |
Binary file added
BIN
+2.36 KB
src/main/resources/edu/rpi/legup/images/skyscrapers/contradictions/TooFew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.