Simple puzzle written in js with angular.js