Hi folks,

Can someone who understands the last challenge give me some guidance on how to complete it?

I’ve done some coding but I know where I’m stuck.

If someone can help me, that would be really appreciative.

Hi folks,

Can someone who understands the last challenge give me some guidance on how to complete it?

I’ve done some coding but I know where I’m stuck.

If someone can help me, that would be really appreciative.

- for the most part the idea is to break it down into stages.
- remember to parse in a string when calling the broadcast function
- and when calling the parseInt function, keep in mind that you are parsing in a hexadecimal number. so you may need to google the number you should parse as a second argument in your call
- and finally remember to call your function to return home at the end

Me too.

What does this line mean?

You’ll need to save the response from each of these calls into it’s own variable

```
function returnToEarth() {
let x = broadcast("x");
let y = broadcast("y");
let z = broadcast("z");
let messageX = decodeMessage(parseInt(x, x));
let messageY = decodeMessage(parseInt(y, y));
let messageZ = decodeMessage(parseInt(z, z));
navigation.x = messageX;
navigation.y = messageY;
navigation.z = messageZ;
}
returnToEarth();
```

This is all I’ve got @JesseKai

I’m not sure what to do in the parseInt part.

@Sinduja like this?

```
let messageX = decodeMessage(parseInt(x, 16));
let messageY = decodeMessage(parseInt(y, 16));
let messageZ = decodeMessage(parseInt(z, 16));
```

why am I getting this error though?

**Your code could not run. Hint: "message.replace is not a function"**

- Decode the returned message using the
`decodeMessage()`

function you wrote earlier - Change the decoded hex-coordinate to an integer using
`parseInt()`

The result you get from decodeMessage() is the hex-coordinate, so you decode first, then parseInt.

let messageX = parseInt(decodeMessage(x), base);

base is the radix that represents hexadecimal.

2 Likes

the order is wrong. put the decodeMessage function inside parseInt and then the base to make it hexidemical which is 16. and then you should use the decodeMessage() to decode the response of each broadcast function. so put that into decodeMessage function.

hope this helps

1 Like

sorry I am still confused decodeMEssage takes a string .can we pass the result of the broadcast fucntion directly to the decodeMEssage