Skip to content

Commit

Permalink
b
Browse files Browse the repository at this point in the history
  • Loading branch information
heyunpeng committed Aug 24, 2015
1 parent 7172da3 commit 294719c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions config/initializers/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,12 @@ def checkGrid (object)
globalgrid = 0
grid = Grid.new
grid.gameid = curtime.strftime("%Y%m%d")+(begin_count+objindex+1).to_s.rjust(2, '0')
loopCount = 0

prizetotal = 0
begin
localcoin = (totalcoin).abs * 0.95
Rails.logger.debug localcoin
localgrid = randomGrid
prizetotal = 0
lssame, lsorder, lsdouble, lscolor = checkGrid(localgrid)

Tracelog.where("gameid = ? and maintype = 1", grid.gameid).each do |log|
Expand Down Expand Up @@ -246,10 +245,10 @@ def checkGrid (object)
end

localcoin -= prizetotal
loopCount += 1
Rails.logger.debug prizetotal
Rails.logger.debug localcoin

if localcoin >= 0 or loopCount > 99 then
if localcoin >= 0 then
globalgrid = localgrid
totalcoin += localcoin
break
Expand Down

0 comments on commit 294719c

Please sign in to comment.