From 52afff883691516ba8be22a519608411bbc669ec Mon Sep 17 00:00:00 2001 From: Bryson Zimmerman Date: Wed, 6 Nov 2024 11:53:44 -0500 Subject: [PATCH] Cleaned up unused items --- src/main/kotlin/World.kt | 8 ++------ src/main/kotlin/data/TileHeap.kt | 11 +++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/World.kt b/src/main/kotlin/World.kt index a977de4..95c7280 100644 --- a/src/main/kotlin/World.kt +++ b/src/main/kotlin/World.kt @@ -45,12 +45,7 @@ object World { //TODO: https://en.wikipedia.org/wiki/Box-drawing_characters //^ make the maze look like a maze override fun toString(): String { - val em = ' ' //Empty character - val fi = '█' //Filled character - val dot = '•' - - val str = StringBuilder() - + val str = StringBuilder() //Reading left to right, top to bottom - can do a simple for each on the rows for (y in 0..tiles.value[0].size - 1) { @@ -63,6 +58,7 @@ object World { str.appendLine() return str.toString() } + fun getTileShape(tile: TileProperties): Char { return when(tile.connections) { UP.dir+DOWN.dir+LEFT.dir+RIGHT.dir -> '╋' diff --git a/src/main/kotlin/data/TileHeap.kt b/src/main/kotlin/data/TileHeap.kt index 6ba7de8..d58abc9 100644 --- a/src/main/kotlin/data/TileHeap.kt +++ b/src/main/kotlin/data/TileHeap.kt @@ -1,6 +1,5 @@ package technology.zim.data -import technology.zim.World import kotlin.math.abs //Translated code from CS222 MaxHeap homework @@ -31,7 +30,7 @@ class TileHeap(val end: Tile) { siftUp(dat.size - 1) } - private fun siftUp(index: kotlin.Int) { + private fun siftUp(index: Int) { if(dat.isEmpty()) throw ArrayIndexOutOfBoundsException() @@ -78,11 +77,11 @@ class TileHeap(val end: Tile) { } //Helper functions for navigating the heap - private fun parent(index: kotlin.Int): kotlin.Int = index / 2 - private fun leftChild(index: kotlin.Int): kotlin.Int = index * 2 - private fun rightChild(index: kotlin.Int): kotlin.Int = (index * 2) + 1 + private fun parent(index: Int): Int = index / 2 + private fun leftChild(index: Int): Int = index * 2 + private fun rightChild(index: Int): Int = (index * 2) + 1 - private fun swap(index1: kotlin.Int, index2: kotlin.Int) { + private fun swap(index1: Int, index2: Int) { val index1tmp = dat[index1] dat[index1] = dat[index2] dat[index2] = index1tmp