Refactor farkle.js with new state variable