Last active
November 29, 2018 22:15
-
-
Save a1ip/d5c79564084926e0a10c to your computer and use it in GitHub Desktop.
CodeCombat Hour of Code: Course 1 Python solutions http://codecombat.com/courses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Освободи союзника и очисть путь для побега! | |
hero.moveRight() | |
hero.attack("Weak Door") | |
hero.moveRight() | |
hero.moveDown() | |
while True: | |
hero.attack("Door") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a CONCEPT challenge about basic syntax. | |
# Соберите все гемы и вернитесь к выходу (красный крест). | |
# Берегитесь шипов. | |
hero.moveUp() | |
hero.moveRight() | |
hero.moveDown() | |
hero.moveRight() | |
hero.moveLeft() | |
hero.moveDown() | |
hero.moveUp(2) | |
hero.moveLeft() | |
hero.moveDown() | |
hero.moveLeft() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hero.moveRight() | |
# Ты должен был познакомиться с этим на предыдущем уровне. | |
enemy1 = hero.findNearestEnemy() | |
# Теперь атакуй `enemy1`. | |
hero.attack(enemy1) | |
hero.attack(enemy1) | |
hero.moveRight(2) | |
enemy2 = hero.findNearestEnemy() | |
hero.attack(enemy2) | |
hero.moveRight() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Не попадайся на глаза ограм. | |
hero.moveRight() | |
hero.moveLeft() | |
hero.moveRight(2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Там может оказаться что-то полезное! | |
# Сначала двигайся к шкафу. | |
hero.moveDown() | |
hero.moveLeft(2) | |
hero.moveUp(2) | |
# Потом атакуй шкаф ("Cupboard") внутри цикла. | |
while True: | |
hero.attack("Cupboard") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Поблизости может быть что-то, что поможет тебе. | |
# Сначала двигайся к Шкафу. | |
hero.moveRight() | |
hero.moveDown() | |
hero.moveRight() | |
hero.moveDown(2) | |
# Потом атакуй Шкаф ( "Cupboard" ) с использованием цикла. | |
while True: | |
hero.attack("Cupboard") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Победи огров используя их имена. | |
hero.moveRight(); | |
# Победи первую пару огров. | |
hero.attack("Sog") | |
hero.attack("Sog") | |
hero.attack("Gos") | |
hero.attack("Gos") | |
hero.moveRight(2); | |
# Победи вторую пару огров. | |
hero.attack("Ergo") | |
hero.attack("Ergo") | |
hero.attack("Kro") | |
hero.attack("Kro") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Атакуй обоих огров и собери самоцветы. | |
hero.moveRight() | |
hero.attack("Krug") | |
hero.attack("Krug") | |
hero.moveRight() | |
hero.moveUp() | |
hero.attack("Grump") | |
hero.attack("Grump") | |
hero.moveLeft(2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Возьми самоцветы и иди к лестнице. | |
hero.moveRight() | |
hero.moveDown() | |
hero.moveRight(2) | |
hero.moveUp() | |
hero.moveRight() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Встань на отметку X и отвлеки стражу приманкой. | |
hero.moveRight() | |
hero.moveDown(2) | |
hero.moveUp(2) | |
hero.moveRight(3) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Избегай огров и возьми самоцвет. | |
hero.moveDown(2) | |
hero.moveRight() | |
hero.moveUp() | |
hero.moveRight() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a concept challenge level about arguments. | |
# Возьми самоцветы и иди к лестнице. | |
# Your code should have no more than 7 commands. | |
# Use movement commands with arguments. | |
hero.moveRight() | |
hero.moveUp(3) | |
hero.moveRight(2) | |
hero.moveDown(3) | |
hero.moveLeft() | |
hero.moveUp(2) | |
hero.moveRight(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Collect all gems and escape at the white X mark. | |
# Use no more than 5 statements. | |
while True: | |
hero.moveUp(2) | |
hero.moveRight(2) | |
hero.moveDown() | |
hero.moveLeft() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Создай вторую переменную и атакуй врага! | |
enemy1 = hero.findNearestEnemy() | |
hero.attack(enemy1) | |
hero.attack(enemy1) | |
enemy2 = hero.findNearestEnemy() | |
hero.attack(enemy2) | |
hero.attack(enemy2) | |
hero.moveDown() | |
hero.moveRight(2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Подбирай светящиеся камни, чтобы отпугнуть скелетов на короткое время. | |
while True: | |
hero.moveUp() | |
hero.moveDown() | |
hero.moveRight(2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Циклы отлично подходят для выполнения повторяющихся команд. | |
while True: | |
# Добавь команды сюда для повторения. | |
hero.moveRight() | |
hero.moveDown() | |
hero.moveRight(2) | |
hero.moveUp() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Перейдите в комнату сокровищ и победите всех огров. | |
hero.moveUp(4) | |
hero.moveRight(4) | |
hero.moveDown(3) | |
hero.moveLeft(2) | |
while True: | |
enemy = hero.findNearestEnemy() | |
hero.attack(enemy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a COMBO challenge level. | |
# Defeat ogres, collect gems, and escape to the red X | |
# using strings and movement arguments! | |
hero.moveDown() | |
hero.moveRight(2) | |
hero.moveUp() | |
hero.attack("Ursa") | |
hero.attack("Ursa") | |
hero.moveLeft(2) | |
hero.moveUp() | |
hero.attack("Rexxar") | |
hero.attack("Rexxar") | |
hero.attack("Brack") | |
hero.attack("Brack") | |
hero.moveRight(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Победи огров. | |
# Помни, что каждому нужно нанести по два удара. | |
hero.attack("Rig") | |
hero.attack("Rig") | |
hero.attack("Gurt") | |
hero.attack("Gurt") | |
hero.attack("Ack") | |
hero.attack("Ack") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment