Currently, CodeCombat’s loop: is virtually equivalent to while True:, so both solutions are correct. CodeCombat evaluates solutions based on whether they achieve the correct end results, not the means to do so.
There’s quite a bit of history behind this as well. CodeCombat has introduced the non-standard “loop” construct so beginners can make loops with simpler syntax and thus focus on the programming logic and not the syntax. Of course, this has some huge downsides, such as teaching syntax (loop:) that is not really being part of the programming language. It seems that CodeCombat is now moving towards favoring while True: over loop: (at least for Courses). See this thread for more info.