Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
📝 Terminal Game Move Function
In this game, the hero moves from left to right. The player rolls the dice and moves the number of spaces indicated by the dice twice.
🏃♂️ Objective:
Create a function for the terminal game that takes the current position of the hero and the roll (1-6) and returns the new position.
🎲 Example:
📝 Explanation:
📋 Steps:
Detailed Example:
3
and the dice roll result is6
, the hero will move 6 spaces twice.move(3, 6)
should return15
.Expected Function:
The function should accept two parameters:
current_position
)roll
)And should return the new position after both moves.
Good luck! 🎲🎮
"Thank you to the kata author and my fellow Codewars members for the support and learning opportunities. I've been improving both my English and Portuguese skills along the way!"
Encountered issue where I had to refresh the page to update and rerun tests.
Unclear if due to caching or server-side processing delays.
I encountered an inconsistency in the calculate_tip function where the return varied between 0 and 'Rating not recognised' depending on the rating input. Initially, the code was set to return 0 when the rating was not recognized in the ratings dictionary. However, upon reviewing the specifications or encountering different test scenarios, I realized that the correct return should be the message 'Rating not recognised' instead of 0 when the rating is not found in the dictionary.
This inconsistency led to divergent results during testing, as the code was adjusted to adhere to specific expectations for recognized and unrecognized ratings.