What's the Secret?
Your friend wants to text you a secret message. But she doesn't want to send it in one text, in case your arch nemesis gets hold of your phone. Instead of just sending the secret message in one text, she's going to split up her secret and send you two messages. The first half of the first message combined with the second half of the second message will give you the full secret message.
The first message is stored in message1 and the second message in message2 Figure out what the full secret message is, using what you've learned so far.
message1.length
=> 10
Oops, please try again. Use the hint button if you would like a hint.
message1fh=message1.substring(0,5)
=> 'i ate'
Oops, please try again. Use the hint button if you would like a hint.
message2.length
=> 24
Oops, please try again. Use the hint button if you would like a hint.
message2sh=message2.substring(12,24)
=> ' your cookie'
Oops, please try again. Use the hint button if you would like a hint.
message1fh+message2sh
=> 'i ate your cookie'
Oh noes, she ate your cookie! What a bad friend.
No comments:
Post a Comment