Need help with a kata

i need some help with a kata, it is not in this website; i have to do an app only using JS, is called the mars rover kata. Any help, resources or samples?

It is not an exercise from this website. It is a challenge that with the theory i learnt here plus how to do grids, i have to do like an app using javascript. the challenge per se is:

Create a function to turn the rover. the rover is dumb so it cant move and turn at the same movement. (you have to use switch statements to set the direction)

Create a function to move the rover forwards or backwards based on its direction.

Create a function to receive a list of commands and move based off of those commands.

then i have to put some obstacles and the function has to say the rover found an obstacle in a 10x10 grid two dimensional array.

im not an expert. i have only done 50 hours in javascript here.

This is what i have done but is not finished.

var rover = {
direction: “N”,
x: 0,
y: 0,
travellog: [],
}

var rover2 = {
direction: “S”,
x: 7,
y: 7,
travelLog:[],
}

var grid = [
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
];

for (var i = 0; i < grid.length; i++){
var row = grid[i];
if (column === “X”){
console.log("Obstacle Found at: " + i + ", " + j);
}
}

function turnLeft(rover) {
switch (ROVdirection) {
case “N”:
ROVdirection = “W”
break;
case “S”:
ROVdirection = “E”
break;
case “E”:
ROVdirection = “N”
case “W”:
ROVdirection = “S”
break;
}

console.log("Rover turns: " + ROVdirection)

}

function turnRight(rover) {
switch (ROVdirection) {
case “N”:
ROVdirection = “E”
break;
case “S”:
ROVdirection = “W”
break;
case “E”:
ROVdirection = “S”
break;
case “W”:
ROVdirection = “N”
break;
}

console.log("Rover turns: " + ROVdirection)
}

function moveForward(rover){
switch(ROVdirection) {
case “N”:
rover.y = rover.y-1
break;
case “S”:
rover.y = rover.y+1
break;
case “E”:
rover.x = rover.x+1
break;
case “W”:
rover.x = rover.x-1
break;
}

Map(rover, “forward”)
}

function moveBackwards(rover) {
switch (ROVdirection) {
case “N”:
rover.y = rover.y+1
break;
case “S”:
rover.y = rover.y-1
break;
case “E”:
rover.x = rover.x-1
break;
case “W”:
rover.x = rover.x+1
break;
}
Map(rover, “backward”)
}

function Commands (rover, command) {
for (var i = 0; i < command.length; i++){
executeCommand (rover, command [i])
if(commandArray[i] == ‘f’) {
moveForward(rover);
}
if(commandArray[i] == ‘b’) {
moveBackwards(rover);
}
if(commandArray[i] == ‘r’) {
turnRight(rover);
}
if(commandArray[i] == ‘l’) {
turnLeft(rover);
}
}
}

i did some changes but any help please?

var rover = {
name: “Rover”,
direction: “N”,
x: 0,
y: 0,
obstacle: [[2.7], [5.5], [6.0], [0.4], [1.2], [4.9]],
toStop: false,
number: 1,
travelLog: ["(0,0)"],
}

var rover2 = {
name: “Rover2”,
direction: “N”,
x: 7,
y: 7,
obstacle: [[2.7], [5.5], [6.0], [0.4], [1.2], [4.9]],
toStop: false,
number: 2,
travelLog:["(7.7)"],
}

var grid = [
[“Rover”,null,null,null,“Rock4”,null,null,null,null,null],
[null,null,“Rock5”,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,“Rock1”,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,“Rock6”],
[null,null,null,null,null,“Rock2”,null,null,null,null],
[“Rock3”,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,“Rover2”,null,null],
[null,null,null,null,null,null,null,null,null,null],
[null,null,null,null,null,null,null,null,null,null],
];

var obstacles = [

{ "name": "Rock1",
  "position": [2.7]
},

{ "name": "Rock2",
  "position": [5.5]
},

{ "name": "Rock3",
  "position": [6.0]
},

{ "name": "Rock4",
  "position": [0.4]
},

{ "name": "Rock5",
  "position": [1.2]
},

{ "name": "Rock6",
  "position": [4.9]
}

];

function turnLeft(rover, rover2) {
switch (ROVdirection) {
case “N”:
ROVdirection = “W”
break;
case “S”:
ROVdirection = “E”
break;
case “E”:
ROVdirection = “N”
case “W”:
ROVdirection = “S”
break;
}

console.log("Rover turns to: " + ROVdirection)

}

function turnRight(rover, rover2) {
switch (ROVdirection) {
case “N”:
ROVdirection = “E”
break;
case “S”:
ROVdirection = “W”
break;
case “E”:
ROVdirection = “S”
break;
case “W”:
ROVdirection = “N”
break;
}

console.log("Rover turns to: " + ROVdirection)
}

function moveForward(rover, rover2, ROVdirection){
switch(ROVdirection) {
case “N”:
rover.y = rover.y-1
break;
case “S”:
rover.y = rover.y+1
break;
case “E”:
rover.x = rover.x+1
break;
case “W”:
rover.x = rover.x-1
break;
}

Map(rover, rover2, “forward”)
}

function moveBackwards(rover, rover2, ROVdirection) {
switch (ROVdirection) {
case “N”:
rover.y = rover.y+1
break;
case “S”:
rover.y = rover.y-1
break;
case “E”:
rover.x = rover.x-1
break;
case “W”:
rover.x = rover.x+1
break;
}
Map(rover, rover2, “backwards”)
}

function Commands (rover, rover2, command) {
var command = prompt( “Hi operator! Give me the sequence of commands to move the rover. Use f (forward), b (backward), l (lleft) or r (right).”);
var command = command.split("");
for (var i = 0; i < command.length; i++) {
if (command[i] == “f”) {
moveForward (rover, rover2, command[i]);
} else if (command[i] == “b”) {
moveBackwards (rover, rover2, command[i]);
} else if (command[i] == “r”) {
turnRight(rover, rover2, command[i]);
} else if (command[i] == “l”) {
turnLeft(rover, rover2, command[i]);
} else {
alert (“Invalid command”);
return Commands (rover, rover2, command)
}
}

}

function Map (rover, rover2){
if((rover.x < 0 && !rover.x > 9) || (rover.y < 0 && rover.y > 9)){
console.log(“rover is out of the map.”)
}
else if((rover2.x < 0 && rover2.x > 9) || (rover2.y < 0 && rover2.y > 9)){
console.log(“rover is out of the map.”)
} else {
checkObstacles (rover, rover2)
CoordinatesLog (rover, rover2)
}
printCoordinates(rover, rover2)
}

function CoordinatesLog (rover, rover2) {
var coordinates = getCoordinates(rover, rover2)
rover.travelLog.push(coordinates)
rover2.travelLog.push(coordinates)
}

function printCoordinates (rover, rover2) {
var coordinates = getCoordinates(rover)
console.log("Rover Coordinates "+coordinates )
}

function getCoordinates(rover){
var coordinates = “(”+rover.x+","+rover.y+")"
return coordinates
}

function checkObstacles(rover, rover2){
var roverCoordinates = getCoordinates(rover, rover2);
if(obstacles.includes(RovCoordinates)){
console.log("Obstacle in: "+RovCoordinates)
}
}