From c1db82d3a50cf83f832512940151cfee3eff2bd9 Mon Sep 17 00:00:00 2001 From: yiyu zhong Date: Mon, 22 Apr 2024 19:45:59 +0800 Subject: [PATCH] Fix src & tests directories' typos. --- src/map/digger.ts | 2 +- src/map/rogue.ts | 2 +- src/map/uniform.ts | 4 ++-- tests/spec/color.js | 6 +++--- tests/spec/eventqueue.js | 2 +- tests/spec/path.js | 12 ++++++------ 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/map/digger.ts b/src/map/digger.ts index 0fd870cd..47d48e1f 100644 --- a/src/map/digger.ts +++ b/src/map/digger.ts @@ -93,7 +93,7 @@ export default class Digger extends Dungeon { do { featureAttempts++; if (this._tryFeature(x, y, dir[0], dir[1])) { /* feature added */ - //if (this._rooms.length + this._corridors.length == 2) { this._rooms[0].addDoor(x, y); } /* first room oficially has doors */ + //if (this._rooms.length + this._corridors.length == 2) { this._rooms[0].addDoor(x, y); } /* first room officially has doors */ this._removeSurroundingWalls(x, y); this._removeSurroundingWalls(x-dir[0], y-dir[1]); break; diff --git a/src/map/rogue.ts b/src/map/rogue.ts index e2fbf96e..cc56abe6 100644 --- a/src/map/rogue.ts +++ b/src/map/rogue.ts @@ -30,7 +30,7 @@ export interface Room { /** - * Dungeon generator which uses the "orginal" Rogue dungeon generation algorithm. See https://github.com/Davidslv/rogue-like/blob/master/docs/references/Mark_Damon_Hughes/07_Roguelike_Dungeon_Generation.md + * Dungeon generator which uses the "original" Rogue dungeon generation algorithm. See https://github.com/Davidslv/rogue-like/blob/master/docs/references/Mark_Damon_Hughes/07_Roguelike_Dungeon_Generation.md * @author hyakugei */ export default class Rogue extends Map { diff --git a/src/map/uniform.ts b/src/map/uniform.ts index 40950913..0af3ce9e 100644 --- a/src/map/uniform.ts +++ b/src/map/uniform.ts @@ -116,8 +116,8 @@ export default class Uniform extends Dungeon { } /** - * Generates connectors beween rooms - * @returns {bool} success Was this attempt successfull? + * Generates connectors between rooms + * @returns {bool} success Was this attempt successful? */ _generateCorridors() { let cnt = 0; diff --git a/tests/spec/color.js b/tests/spec/color.js index 6c15e6a8..df3e447c 100644 --- a/tests/spec/color.js +++ b/tests/spec/color.js @@ -104,7 +104,7 @@ describe("Color", function() { it("should handle named colors", function() { expect(ROT.Color.fromString("red")).toEqual([255, 0, 0]); }); - it("should not handle nonexistant colors", function() { + it("should not handle nonexistent colors", function() { expect(ROT.Color.fromString("lol")).toEqual([0, 0, 0]); }); }); @@ -128,7 +128,7 @@ describe("Color", function() { }); describe("interpolate", function() { - it("should intepolate two colors", function() { + it("should interpolate two colors", function() { expect(ROT.Color.interpolate([10, 20, 40], [100, 200, 300], 0.1)).toEqual([19, 38, 66]); }); it("should round values", function() { @@ -140,7 +140,7 @@ describe("Color", function() { }); describe("interpolateHSL", function() { - it("should intepolate two colors", function() { + it("should interpolate two colors", function() { expect(ROT.Color.interpolateHSL([10, 20, 40], [100, 200, 300], 0.1)).toEqual([12, 33, 73]); }); }); diff --git a/tests/spec/eventqueue.js b/tests/spec/eventqueue.js index 58ff4d29..a5dcfbce 100644 --- a/tests/spec/eventqueue.js +++ b/tests/spec/eventqueue.js @@ -45,7 +45,7 @@ describe("EventQueue", function() { expect(q.get()).toEqual(456); }); - it("should survive removal of non-existant events", function() { + it("should survive removal of non-existent events", function() { var q = new ROT.EventQueue(); q.add(0, 0); var result = q.remove(1); diff --git a/tests/spec/path.js b/tests/spec/path.js index b94a7e49..e5629fab 100644 --- a/tests/spec/path.js +++ b/tests/spec/path.js @@ -85,7 +85,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { dijkstra.compute(X[0], X[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); }); @@ -106,7 +106,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { dijkstra.compute(X[0], X[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); }); @@ -127,7 +127,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { dijkstra.compute(X6[0], X6[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); }); @@ -151,7 +151,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { astar.compute(X[0], X[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); }); @@ -178,7 +178,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { astar.compute(X[0], X[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); }); @@ -199,7 +199,7 @@ describe("Path", function() { expect(PATH.toString()).toEqual(PATH_B.toString()); }); - it("should survive non-existant path X", function() { + it("should survive non-existent path X", function() { astar.compute(X6[0], X6[1], PATH_CALLBACK); expect(PATH.length).toEqual(0); });