1. Home
  2. /
  3. Codecombat
  4. /
  5. Collect Coin Example

Collect Coin Example - Codecombat Typing CST Test

Loading…

Collect Coin Example — Codecombat Code

Makes the hero collect the nearest coin.

coin = hero.findNearestItem()
if coin:
	hero.move(coin.pos)

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 EnemyMove and Attack SequenceUsing While LoopMove to Specific PositionSay a Message Multiple TimesAttack if Health is GoodCollect All Items in Range

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher