FTL clone written in javascript