From 8d95463a9e2a58e3f37486af671d7f4a063a26a1 Mon Sep 17 00:00:00 2001 From: Bryson Zimmerman Date: Sun, 3 Nov 2024 19:09:21 -0500 Subject: [PATCH 1/3] Mild wording update --- src/main/kotlin/MazeFinder.kt | 4 +--- src/main/kotlin/data/TileProperties.kt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/MazeFinder.kt b/src/main/kotlin/MazeFinder.kt index a5c5f64..e92df7f 100644 --- a/src/main/kotlin/MazeFinder.kt +++ b/src/main/kotlin/MazeFinder.kt @@ -26,8 +26,6 @@ object MazeFinder { } fun primsAlgorithm() { - - //Prime the graph with the first connection, which marks the first visited Tiles val startingTile = World.getRandomLocation() val tmpIndex = randGen.nextInt(Directions.ALL.size) @@ -72,7 +70,7 @@ object MazeFinder { current.getAdjacentTiles(false).forEach { tile -> val tileprops = World.get(tile) - if(!tileprops.isManifested()) { + if(!tileprops.isManifest()) { World.update(tile, tileprops + Directions.MANIFEST) frontier.add(tile) } diff --git a/src/main/kotlin/data/TileProperties.kt b/src/main/kotlin/data/TileProperties.kt index b59f073..20994e4 100644 --- a/src/main/kotlin/data/TileProperties.kt +++ b/src/main/kotlin/data/TileProperties.kt @@ -54,7 +54,7 @@ value class TileProperties(val connections: Int) { return connections and(DOWN.dir) == DOWN.dir } - fun isManifested(): Boolean { + fun isManifest(): Boolean { return connections and(MANIFEST.dir) == MANIFEST.dir } From d516368ced7968e12cb88600f5b11c537d64d15e Mon Sep 17 00:00:00 2001 From: Bryson Zimmerman Date: Sun, 3 Nov 2024 19:10:17 -0500 Subject: [PATCH 2/3] Start on Heap --- src/main/kotlin/data/Heap.kt | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/main/kotlin/data/Heap.kt diff --git a/src/main/kotlin/data/Heap.kt b/src/main/kotlin/data/Heap.kt new file mode 100644 index 0000000..33a018e --- /dev/null +++ b/src/main/kotlin/data/Heap.kt @@ -0,0 +1,60 @@ +package technology.zim.data + +class Heap { + private val dat = ArrayList() + + fun popMin(): T { + if(dat.isEmpty()) { + throw ArrayIndexOutOfBoundsException() + } + + val ret = dat.first() + + //TODO: Sift and such + return dat.first() + } + + fun popMax(): T { + if(dat.isEmpty()) { + throw ArrayIndexOutOfBoundsException() + } + + val ret = dat.last() + + return ret + } + + fun insert(value: T) { + dat.add(value) + //TODO: siftUp, siftDown + + } + + private fun siftUp() { + + } + + private fun siftDown() { + + } + + private fun delete() { + + } + + fun peekMax(): T { + if(dat.isEmpty()) { + throw ArrayIndexOutOfBoundsException() + } + + return dat.last() + } + + fun peekMin(): T { + if(dat.isEmpty()) { + throw ArrayIndexOutOfBoundsException() + } + return dat[0] + } + +} \ No newline at end of file From ab2421ffad6feca0650c440185417c6efa8a2905 Mon Sep 17 00:00:00 2001 From: Bryson Zimmerman Date: Sun, 3 Nov 2024 19:14:48 -0500 Subject: [PATCH 3/3] Stop tracking .idea/workspace.xml --- .idea/workspace.xml | 506 -------------------------------------------- 1 file changed, 506 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 8d6b0e1..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file