Colony

Reset

Alpha-00

Load! Help! Reload! Go! Stop! Next! Help!

Background

You are the Alpha unit sent to a new world to exploit it's resources. You have been gifted with artificial intelligence which allows you to make decisions on mining, building and researching. You are also self-adapting, rewriting your code to be more efficient. How smart can you become?

AI

The AI has two main settings: manual and AI. In manual mode you can play the game by interacting with the screen. Click "Mine!" to earn resources or build units. More units will allow you to gain resources automatically as time ticks by. There is also an "auto-click" option which will continue to click while running.

AI mode allows you to write JavaScript to handle all actions for you. In this mode time can go by much faster as the AI can calculate multiple steps quickly. At any time you can switch between the two modes.

Programming

You must implement the Alpha.prototype.execute function. You can add any other functions that you may need to call. The most basic program, which just keeps clicking, is:

Alpha.prototype.execute = function(colony){
  this.click(1);
}
					

The best way to debug is to use your browser's developer tools (usually by hitting F12). Your code is executed in a sandbox by using web workers so make sure you inspect the code loaded in the web worker. In Chrome this can be found under Sources->Right panel->Workers->blob:...

Action

The main code continually calls Alpha.prototype.execute. Your execute function should take one and only one action everytime it is called.

this.click(num)
Clicks for num of seconds
this.none(num)
Does nothing for num of seconds
this.build(id)
Buys the unit or building with id id over 1 second
this.upgrade(id)
Buys the upgrade id id over 1 second
this.recycle(id)
Recycles the unit or building with id id over 1 second

Alpha.prototype.execute is passed a colony object which has lots of information about units, upgrades and current status.

For example, you can calculate the number of seconds it will be before buying the unit you want, click passing in that many seconds and then when execute happens again buy your unit.

Example which determines the best price/benefit and waits to buy that.

Reference

For a complete reference of the colony object, see complete documentation. Please note that the colony's functions are not available in the sandbox, only read only properties. Changing the values in the colony object will have no effect in the game.

Mine!

Final Score: