Skip to content

Instantly share code, notes, and snippets.

View esova-ana's full-sized avatar

Ana Esova esova-ana

View GitHub Profile
/*****************************************************************************
Defeat the enemy hero in a duel!
*****************************************************************************/
var SELF = this;
SELF.ATTACK = function (enemy, xE, yE) {
if (SELF.distanceTo(enemy) <= 7) {
SELF.attack(enemy);
} else {
if (isApproaching(enemy)) {
SELF.shield();
@esova-ana
esova-ana / gist:f25d6149730e0721d60469306289e91f
Last active April 15, 2016 02:06
CodeCombat - findFarthest/findNearest
//FIND FARTHEST
var enemy;
loop {
var farthest = null;
var maxDistance = 0;
var enemyIndex = 0;
var enemies = this.findEnemies();
while (enemyIndex < enemies.length) {
var target = enemies[enemyIndex];
@esova-ana
esova-ana / gist:b4d5b39a45e824b78706
Last active March 8, 2019 11:50
JavaScript CheetSheet
/* //////////////////////////////////////////////////////
// STRINGS, NUMBERS, VARIABLES AND LOOPS //
//////////////////////////////////////////////////////*/
// 1. Single-line comments start with two slashes.
/* Multiline comments start with slash-star,
and end with star-slash */
// 2. JavaScript has a number type
@esova-ana
esova-ana / gist:9fd6594652deb7a5df6c
Last active February 10, 2016 16:06
SPECIAL CHARACTERS
{ - shift alt š
} - shift alt đ
[ - alt š
] - alt đ
= - shift 0
< - <
> - shift <
, - ,
; - shift ,
. - .
My Hotkeys:
CTRL T (in the browser) - opens a new tab
CTRL SHIFT T (in the browser) - reopens recently cosed tab
CTRL C - copy the text
CTRL V - paste the text