Cleaned up unused items

main
Bryson Zimmerman 11 months ago
parent 9a5d021f3f
commit 52afff8836

@ -45,13 +45,8 @@ 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()
//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) {
//Upper line: Print each tile, print right-hand connections
@ -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 -> '╋'

@ -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

Loading…
Cancel
Save