• Determine The Trajectory Of Frogs And Make Sure Your Code Doesn't Stink

Hello, checkiomates🐱‍👤!

Let's find out if frogs will intersect and learn how to make your code less "stinky".

💡TIP

On Easy difficulty, each of the few starting stations is dedicated to a distinct data type. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

🏁MISSION

Frogs Collision by freeman_lex -

In the vast expanse of an infinite two-dimensional grid, two adventurous frogs embark on their hopping journey. Each frog, characterized by a unique 4-tuple, sets forth with determination. Their positions at time t=0 and constant directional vectors propel them forward through discrete time steps. As they leap across the grid, the question arises: will their paths intertwine? The challenge beckons for a solution to determine the precise moment when both frogs, frog1 and frog2, synchronize their hops onto the same square. Should fate decree their paths never to converge, the function shall gracefully return None, leaving their trajectories to wander in parallel, never to intersect.

frogs_collision((0, 0, 0, 2), (0, 10, 0, 1)) == 10
frogs_collision((10, 10, -1, 0), (0, 1, 0, 1)) == None

📖ARTICLE

Fix Python Code Smells with These Best Practices -

By finding and refactoring this stinky code, we can make our codebase more maintainable, readable, and scalable. This will make it easier for us to add new features, fix bugs, and collaborate with other developers.

👩‍💻CODE SHOT

How do you think, what the following code does?

?????? = lambda num: len(__import__("re").search('0*$', str(num)).group(0))

🙌 Thanks for your attention! Hope to meet you at CheckiO. We are really interested in your thoughts! Please, leave a comment below! ⤵

Welcome to CheckiO - games for coders where you can improve your codings skills.

The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.

Join the Game