This commit is contained in:
mike
2026-01-13 20:03:19 +01:00
parent 81ae0aa84c
commit 6ab6791d9c
6 changed files with 114 additions and 83 deletions

View File

@@ -19,11 +19,11 @@ import static puzzle.SwedishGenerator.*;
public class ExportFormatTest {
static final byte CLUE_DOWN = 0;
static final byte CLUE_DOWN = 0;
static final byte CLUE_RIGHT = 1;
static final byte CLUE_UP = 2;
static final byte CLUE_LEFT = 3;
static final byte CLUE_UP = 2;
static final byte CLUE_LEFT = 3;
@Test
void testExportFormatFromFilled() {
var swe = new SwedishGenerator(new Rng(0));
@@ -33,10 +33,10 @@ public class ExportFormatTest {
grid.setClue(0, CLUE_RIGHT);
// This creates a slot starting at (0,1)
var clueMap = new HashMap<Integer, Long>();
var clueMap = new long[300];
// key = (cellIndex << 2) | (direction)
var key = (0 << 2) | (CLUE_RIGHT);
clueMap.put(key, Lemma.from("TEST"));
var key = (0 << 2) | (CLUE_RIGHT);
clueMap[key] = Lemma.from("TEST");
// Manually fill the grid letters for "TEST" at (0,1), (0,2), (0,3), (0,4)
grid.setLetter(Grid.offset(0, 1), (byte) 'T');
@@ -86,7 +86,7 @@ public class ExportFormatTest {
void testExportFormatEmpty() {
var swe = new SwedishGenerator(new Rng(0));
var grid = Grid.createEmpty();
var fillResult = new FillResult(true, new Gridded(grid), new HashMap<>(), new FillStats());
var fillResult = new FillResult(true, new Gridded(grid), new long[300], new FillStats());
var puzzleResult = new PuzzleResult(swe, null, null, fillResult);
var exported = puzzleResult.exportFormatFromFilled(1, new Rewards(0, 0, 0));