A algorithm battl3 based on javascript.