|
@ -1,11 +1,21 @@ |
|
|
const vierDiagonalRechts = require("../JS/vierDiagonalRechts"); |
|
|
const vierDiagonalRechts = require("../JS/vierDiagonalRechts"); |
|
|
|
|
|
|
|
|
describe("Test Vier Gewinnt", () => { |
|
|
describe("Test Vier Gewinnt", () => { |
|
|
it("Test vierDiagonalRechts: Vier Diagonal erkennen und Gewinner zuruek geben", () =>{ |
|
|
|
|
|
|
|
|
it("Test vierDiagonalRechts: Vier Diagonal erkennen und Gewinner 1(Gruen) zuruek geben", () =>{ |
|
|
expect(vierDiagonalRechts([[1, 0, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0], [2, 1, 1, 0, 0, 0], [2, 2, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[1, 0, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0], [2, 1, 1, 0, 0, 0], [2, 2, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 1, 2, 1, 0], [2, 2, 1, 2, 1, 1], [0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 1, 2, 1, 0], [2, 2, 1, 2, 1, 1], [0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0], [2, 1, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [1, 2, 1, 2, 1, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0], [2, 1, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [1, 2, 1, 2, 1, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 2, 1, 1, 0], [2, 2, 1, 2, 1, 1]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 2, 1, 1, 0], [2, 2, 1, 2, 1, 1]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 2, 1, 1, 0], [2, 2, 1, 2, 1, 1], [1, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [1, 2, 1, 0, 0, 0], [2, 1, 2, 1, 0, 0], [2, 1, 2, 1, 1, 0], [2, 2, 1, 2, 1, 1], [1, 0, 0, 0, 0, 0]])).toBe(1); |
|
|
}) |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
describe("Test Vier Gewinnt", () => { |
|
|
|
|
|
it("Test vierDiagonalRechts: Vier Diagonal erkennen und Gewinner 2 (rot) zuruek geben", () =>{ |
|
|
|
|
|
expect(vierDiagonalRechts([[2, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0], [1, 2, 2, 0, 0, 0], [1, 1, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(2); |
|
|
|
|
|
expect(vierDiagonalRechts([[2, 1, 2, 0, 0, 0], [1, 2, 1, 2, 0, 0], [1, 2, 2, 1, 2, 0], [1, 1, 2, 1, 2, 2], [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]])).toBe(2); |
|
|
|
|
|
expect(vierDiagonalRechts([[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [1, 2, 0, 0, 0, 0], [1, 2, 2, 0, 0, 0], [1, 2, 1, 2, 0, 0], [2, 1, 2, 1, 2, 0]])).toBe(2); |
|
|
|
|
|
expect(vierDiagonalRechts([[1, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [2, 1, 2, 0, 0, 0], [1, 2, 1, 2, 0, 0], [1, 2, 1, 2, 2, 0], [1, 1, 2, 1, 2, 2]])).toBe(2); |
|
|
|
|
|
expect(vierDiagonalRechts([[1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [2, 1, 2, 0, 0, 0], [1, 2, 1, 2, 0, 0], [1, 2, 1, 2, 2, 0], [1, 1, 2, 1, 2, 2], [2, 0, 0, 0, 0, 0]])).toBe(2); |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |