Skip to content

Instantly share code, notes, and snippets.

@kurtkaiser
Last active October 22, 2018 15:53
Show Gist options
  • Save kurtkaiser/e37d791d03039967dce0ca7350b0c920 to your computer and use it in GitHub Desktop.
Save kurtkaiser/e37d791d03039967dce0ca7350b0c920 to your computer and use it in GitHub Desktop.
Code Combat - JavaScript - Introduction to Computer Science
// Code Combat - JavaScript
// Introduction to Computer Science
// Move towards the gem.
// Don’t touch the spikes!
// Type your code below and click Run when you’re done.
hero.moveRight();
hero.moveDown();
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// Grab all the gems using your movement commands.
hero.moveRight();
hero.moveDown();
hero.moveUp();
hero.moveUp();
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// Avoid being seen by the ogre. Collect all the gems.
hero.moveRight();
hero.moveUp();
hero.moveRight();
hero.moveDown();
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// Kounter Kithwise - Level 3A
// Avoid the ogres and grab the gem.
hero.moveDown();
hero.moveDown();
hero.moveRight();
hero.moveUp();
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// Crawlways of Kithgard - Level 3B
// Avoid being seen by the ogres.
hero.moveRight();
hero.moveLeft();
hero.moveRight();
hero.moveRight();
//Introduction to Computer Science
// Enemy Mine - Level 4
// Use arguments with move statements to move farther.
hero.moveRight(3);
hero.moveUp();
hero.moveRight();
hero.moveDown(3);
hero.moveRight(2);
// Code Combat - JavaScript
// Introduction to Computer Science
// Illusory Interruption - Level 4A
// Use the Decoy to distract the guards by stepping on the X.
hero.moveRight();
hero.moveDown();
hero.moveDown();
hero.moveUp();
hero.moveUp();
hero.moveRight(3);
// Code Combat - JavaScript
// Introduction to Computer Science
// Forgetful Gemsmith - Level 4B
// Grab the gems and go to the exit.
hero.moveRight();
hero.moveDown();
hero.moveRight();
hero.moveRight();
hero.moveUp();
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// True Names - Level 5
// Defend against "Brak" and "Treg"!
// You must attack small ogres twice.
hero.moveRight();
hero.attack("Brak");
hero.attack("Brak");
hero.moveRight();
hero.attack("Treg");
hero.attack("Treg");
hero.moveRight();
// Code Combat - JavaScript
// Introduction to Computer Science
// Favorable Odds - Level 5A
// Attack both ogres and grab the gem.
hero.moveRight();
hero.attack("Krug");
hero.attack("Krug");
hero.moveRight();
hero.moveUp();
hero.attack("Grump");
hero.attack("Grump");
hero.moveLeft();
hero.moveLeft();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment