Update lottery.js

Updated the generateMethod()