JavaScript implementation of Rogue