61 lines
2.2 KiB
Java
61 lines
2.2 KiB
Java
package puzzle;
|
|
|
|
import anno.ConstGen;
|
|
import gen.Test123X_Neighbors4x3;
|
|
import gen.Test123X_Neighbors9x8;
|
|
import lombok.val;
|
|
import org.junit.jupiter.api.Assertions;
|
|
import org.junit.jupiter.api.Test;
|
|
import puzzle.Export.Puzzle;
|
|
import puzzle.Export.PuzzleResult;
|
|
import puzzle.Export.Rewards;
|
|
import puzzle.Export.Signa;
|
|
import puzzle.Export.Vestigium;
|
|
import puzzle.SwedishGenerator.Rng;
|
|
import puzzle.dict800.DictData800;
|
|
import puzzle.dict800_4.DictData800_4;
|
|
import java.util.Arrays;
|
|
import java.util.stream.Collectors;
|
|
import static precomp.Const3x4.Cell.r0c0d4;
|
|
import static precomp.Const3x4.Cell.r0c2d0;
|
|
import static precomp.Const3x4.Cell.r1c0d1;
|
|
import static precomp.Const3x4.Cell.r2c0d1;
|
|
import static precomp.Const3x4.Cell.r3c0d1;
|
|
@ConstGen(C = 3, R = 4, packageName = "precomp", className = "Const3x4")
|
|
public class TestDuplication {
|
|
|
|
@Test
|
|
void test() {
|
|
Test123.start();
|
|
Test123X_Neighbors4x3.start();
|
|
Test123X_Neighbors9x8.start();
|
|
}
|
|
static void main() {
|
|
TestDuplication test = new TestDuplication();
|
|
test.testFiller2();
|
|
}
|
|
@Test
|
|
void testFiller2() {
|
|
var mask = Signa.of(
|
|
r0c0d4, r0c2d0,
|
|
r1c0d1,
|
|
r2c0d1,
|
|
r3c0d1);
|
|
Assertions.assertEquals(5, mask.clueCount());
|
|
val map = mask.stream().collect(Collectors.toMap(Vestigium::index, Vestigium::clue));
|
|
Assertions.assertEquals(5, map.size());
|
|
var slots = Masker_Neighbors3x4.slots(mask.c(), DictData800_4.DICT800);
|
|
var grid = Masker_Neighbors3x4.grid(slots);
|
|
var filled = SwedishGenerator.fillMask(new Rng(1), slots, grid.lo, grid.hi, grid.g);
|
|
grid.lo = Masker_Neighbors3x4.MASK_LO & ~mask.c().lo;
|
|
grid.hi = Masker_Neighbors3x4.MASK_HI & ~mask.c().hi;
|
|
var grid1 = new ExportX_Const3x4.Puzzle(grid, mask.c());
|
|
var result = new ExportX_Const3x4.PuzzleResult(new ExportX_Const3x4.Signa(mask.c()), grid1, slots, filled);
|
|
if (filled.ok()) {
|
|
System.out.println(filled);
|
|
val res = result.exportFormatFromFilled(new ExportX_Const3x4.Rewards(0, 0, 0), Masker_Neighbors3x4.IT);
|
|
System.out.println(String.join("\n", res.grid()));
|
|
}
|
|
}
|
|
}
|