$ cat post/coding-challenges-unlocked.md

Coding Challenges Unlocked


I’ve been spending hours on the new coding challenges that just launched. They’re all about solving puzzles with loops and conditionals—basically making sure the computer does what I want it to do step by step. The latest challenge is about creating a game where a character moves around and collects objects, but there are traps too!

I’m stuck on one part where I need to make sure the character doesn’t fall into a pit. I’ve tried setting up multiple if statements to check for certain conditions, like checking the floor tile right below my moving character. It’s really tricky because sometimes they do fall in by accident, and I keep getting errors.

But it’s also fun figuring out ways around these bugs. Today, I added an extra condition where the character can only move down if there’s no pit below them for three consecutive steps. That helped quite a bit!

I also tried to optimize my code so it doesn’t run too slow when checking the floor tiles every step. I ended up using arrays and loops more efficiently, which made things faster. It feels good to see that optimization work; it’s like I’m making the computer dance to my tune.

Tonight, I’ll try adding a small power-up where the character can temporarily ignore pits for one step. That should make it more interesting and give me another challenge to solve!