robbyRobot/robbyRobot4.js
// Function to find cell with the lowest total cost from costs
Function to find cell with the lowest total cost from costs
Function to find cell with the lowest total cost from costs
function lowestCostCell(costs, processed) {
      let cell = costsHeap.remove()
      let lowest = null
      while (cell) {
        if (!processed.includes(cell.cellId)) {
          lowest = cell.cellId
          return lowest
        } else {
          cell = costsHeap.remove()
        }
      }
      return lowest
    }
function lowestCostCell ( costs , processed ) { let cell = costsHeap . remove ( ) let lowest = null while ( cell ) { if ( ! processed . includes ( cell . cellId ) ) { lowest = cell . cellId return lowest } else { cell = costsHeap . remove ( ) } } return lowest }
Function to find cell with the lowest total cost from costs
Function to find cell with the lowest total cost from costs
// if (lowest === null || ( costs[cellId]+calcH(cells[cellId])) < (costs[lowest]+calcH(cells[lowest])) ) {        