코틀린(Kotlin, Java)
recursive call with tailrec
tailrec fun pathFinder(grid: Array, tNode : GNode, fromWhere : Direction, direction : Direction, pathLengh : Int, setMap : MutableMap) { if(tNode.carvingRecord(fromWhere, direction)){ //available to move on next step //get next node val nextNode = tNode.nextNode(direction) //get next node direction val nextDirection = when(grid[nextNode.first][nextNode.second]){ 's', 'S' -> { when(direction){ Di..
2022. 2. 21. 01:37