1. Home
  2. /
  3. Codecombat
  4. /
  5. Using While Loop

Using While Loop - Codecombat Typing CST Test

Loading…

Using While Loop — Codecombat Code

Keeps attacking enemies until none remain.

while True:
	enemy = hero.findNearestEnemy()
	if enemy:
		hero.attack(enemy)
	else:
		break

Codecombat Language Guide

CodeCombat is an educational platform that teaches programming through an interactive game. Players write real code to control characters, solve puzzles, and progress through levels, making learning programming fun and engaging.

Primary Use Cases

  • ▸Learning programming concepts through gameplay
  • ▸Gamified coding challenges for students
  • ▸Classroom curriculum support for computer science
  • ▸Introductory programming for non-programmers
  • ▸Competitive coding exercises and tournaments

Notable Features

  • ▸Interactive game levels requiring code to progress
  • ▸Supports multiple real programming languages
  • ▸Immediate feedback from code execution in the game
  • ▸Built-in tutorials, hints, and guides for beginners
  • ▸Level editor for custom coding challenges

Origin & Creator

Created by George Saines, Matt Marcou, and Scott Erickson in 2013, inspired by the need for an engaging way to teach programming to students.

Industrial Note

Primarily used in education, coding bootcamps, and classrooms; has influenced gamified learning approaches but is not widely used in professional software development.

More Codecombat Typing Exercises

Hello World in CodeCombat (Python)Move Forward ExampleAttack Nearest EnemyCollect Coin ExampleMove and Attack SequenceMove to Specific PositionSay a Message Multiple TimesAttack if Health is GoodCollect All Items in Range

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher