a kata which how to change if statement into loop statement step by step