Started work on matrix generation

This commit is contained in:
mstiMarcel
2020-12-18 14:00:15 +01:00
parent 639fcf8c6e
commit 744935b18e
4 changed files with 358 additions and 66 deletions

View File

@@ -0,0 +1,24 @@
import "jest"
import seedrandom from "seedrandom";
import {generateGameConfig} from "./MatrixGeneration";
import GameConfiguration from "./GameConfiguration";
describe("MatrixGen", () => {
test("random generator works", () => {
const seededRNG = seedrandom("Testseed");
expect(seededRNG()).toEqual(0.026130760816951273);
expect(seededRNG()).toEqual(0.24232428305919648);
});
test("basic game config creation", () =>{
const gameConfig : GameConfiguration = generateGameConfig(1, "Testseed");
expect(gameConfig).not.toBeNull;
expect(gameConfig.matrix).not.toBeNull;
console.log(gameConfig.matrix);
expect(gameConfig.maxBufferLength).not.toBeNull;
expect(gameConfig.sequences).not.toBeNull;
console.log(gameConfig.sequences);
expect(gameConfig.timeout).not.toBeNull;
});
});