Simple robots in javascript