About This Game
This is the most ambitious story on the site. A kid gets launched into space at near light speed. He lands on what he thinks is an alien planet. It's his own neighborhood. The rockets failed. He never left. But here's the thing I love: even though the mission failed, the physics is real. Time dilation is a real thing. Einstein proved it. If you travel fast enough, time actually slows down for you. Not a metaphor. Not science fiction. Actual physics.
The coding lesson covers a bunch of new ideas at once. Functions. Math.sqrt and Math.pow. Try-catch error handling. Comments. It's the most code in any of the challenges. But I built it so you can change one number — the speed — and immediately see how it changes everything. Try 0.5. Try 0.9. Try 0.99. At 99% light speed, one year on the ship is over seven years on Earth. Your friends would age seven years while you aged one. That's not my opinion. That's Einstein. I just wrote the calculator.
The try-catch block is my excuse to teach error handling. What happens if someone enters a speed of 1.0? That's the speed of light. The math breaks because you'd be dividing by zero. Without a try-catch, the program crashes. With one, it catches the error and says something helpful instead. That's what good code does. It expects things to go wrong. Like Tom expected his rocket to work. Expect the unexpected. That's programming and, apparently, space travel.
I get weirdly emotional about this story too. Not the funny ending. The idea that a kid tried something huge and it didn't work out the way he planned. But he still learned something. He still had an adventure. The code ran. The math was right. The rockets just didn't cooperate. Sounds like most of my projects, honestly.
How to Play
Read the story. Feel bad for Tom. Then play with the time dilation calculator. Change the speed value and run it. 0.5 is half the speed of light. 0.99 is almost there. See how time stretches. Try adding a loop that calculates time dilation for speeds from 0.1 to 0.9. If you break it, that's what try-catch is for. The program won't crash. It'll just tell you what went wrong. That's the whole lesson.
Game Details
The time dilation math in this one is real. Einstein's actual formula. Try speed 0.99 and watch what happens to time. Physics is wild.