Exemplo n.º 1
0
 @Override
 public Map<Cell, BitSet> getRedPotentials(int viewNum) {
   Map<Cell, BitSet> removable = super.getRemovablePotentials();
   Map<Cell, BitSet> result = new HashMap<Cell, BitSet>();
   for (Cell cell : removable.keySet()) {
     BitSet values = (BitSet) removable.get(cell).clone();
     values.set(value); // orange
     result.put(cell, values);
   }
   return result;
 }
Exemplo n.º 2
0
 @Override
 public Map<Cell, BitSet> getGreenPotentials(int viewNum) {
   Map<Cell, BitSet> result = new HashMap<Cell, BitSet>();
   BitSet b1 = (BitSet) extraValues.get(bugCell1).clone();
   b1.set(value); // orange
   result.put(bugCell1, b1);
   BitSet b2 = (BitSet) extraValues.get(bugCell2).clone();
   b2.set(value); // orange
   result.put(bugCell2, b2);
   return result;
 }
Exemplo n.º 3
0
 @Override
 public String toHtml() {
   String result = HtmlLoader.loadHtml(this, "BivalueUniversalGrave4.html");
   String bugValuesAnd = ValuesFormatter.formatValues(allExtraValues, " and ");
   String bugCellsAnd = ValuesFormatter.formatCells(new Cell[] {bugCell1, bugCell2}, " and ");
   String bugCellsOr = ValuesFormatter.formatCells(new Cell[] {bugCell1, bugCell2}, " or ");
   String bugValuesOr = ValuesFormatter.formatValues(allExtraValues, " or ");
   String lockedValue = Integer.toString(value);
   String regionName = region.toString();
   BitSet removable = new BitSet();
   for (BitSet r : getRemovablePotentials().values()) removable.or(r);
   String removableValues = ValuesFormatter.formatValues(removable, " and ");
   return HtmlLoader.format(
       result,
       bugValuesAnd,
       bugCellsAnd,
       bugCellsOr,
       bugValuesOr,
       lockedValue,
       regionName,
       removableValues);
 }