Skip to content

Instantly share code, notes, and snippets.

@ap0ught
ap0ught / codecombat village-guard
Created July 16, 2015 20:28
codecombat village-guard
# Patrol the village entrances.
# If you find an enemy, attack it.
loop:
self.moveXY(35, 34)
leftEnemy = self.findNearest(self.findEnemies())
if leftEnemy:
self.attack(leftEnemy)
self.attack(leftEnemy)
# Now move to the right entrance.
# Use "if" to attack if there is an enemy.
@ap0ught
ap0ught / codecombat endangered-burl
Created July 16, 2015 20:26
codecombat endangered-burl
# Only attack enemies of type "munchkin" and "thrower".
# Don't attack a "burl". Run away from an "ogre"!
loop:
enemy = self.findNearest(self.findEnemies())
# Remember: don't attack type "burl"!
if enemy.type is "burl":
self.say("I'm not attacking that Burl!")
# The "type" property tells you what kind of creature it is.
if enemy.type is "munchkin":
self.attack(enemy)
@ap0ught
ap0ught / codecombat the agrippa defense
Last active August 29, 2015 14:25
codecombat the agrippa defense
loop:
bob = self.findNearest(self.findEnemies())
if bob:
if (self.distanceTo(bob) > 1) :
self.say("come closer")
if self.isReady("cleave"):
if len(self.findEnemies()) > 4 :
self.attack(bob)
self.cleave(bob)
if self.isReady("bash"):
@ap0ught
ap0ught / codecombat the-gauntlet
Created July 15, 2015 16:10
codecombat the-gauntlet
self.warcry()
self.moveXY(54,22)
for bob in self.findEnemies():
self.attack(bob)
@ap0ught
ap0ught / codecombat signs-and-portents
Created June 24, 2015 17:05
codecombat signs-and-portents
# Your goal is to get to the right side of the map alive.
# You don't need to fight the ogres, just move! Your allies will protect you.
self.moveRight(2)
self.moveUp()
self.moveRight(3)
self.moveDown()
self.moveRight()
self.moveDown()
self.moveRight()
@ap0ught
ap0ught / kithgard-mastery
Created June 24, 2015 16:13
kithgard-mastery for codecombat
# this needs a loop to determine where you can move and also I might want to look up how to use methods
#status: works
# Reach the end of the maze using move commands.
# Count how many gems you pick up, and then say the current count when near a fireball trap to disable it.
# The raven at the start will give you a password. Say the password near a door to open it.
# Kill ogres when you get near them.
# You can use a loop to repeat all of the instructions as needed.
# If you beat this level, you can skip to the Forest World!
loop:
self.moveRight()
@ap0ught
ap0ught / main_out.js
Last active August 29, 2015 14:21 — forked from edolganov/main_out.js
//replace http://agar.io/main_out.js by this file
//with Fiddler Web Debugger (AutoResponder tab)
//bots can be created in different rooms - so try restart the page if need
var totalBotCount = 0;
function game(h, r, bot, botUrl, botName) {
require "csv"
require 'action_controller/test_process'
file = `ls upload/*.csv | grep -v and-r`.chomp
info = CSV.read(ARGV.first || file)
info.shift
# TODO: set this list by eliminating the expected cols
properties = %w[Colour Material Size Weight Warranty] + ["Pole Diameter", "Fits Pole Size"]