GregoryCannon / StackRabbit

An AI for playing NES Tetris at a high level. Based primarily on search & heuristic, with high quality board evaluation through value iteration.
434 stars 45 forks source link

fix bug in ts function getDifficultyToFillCell #21

Closed NguyenQuangMinh0504 closed 1 month ago

NguyenQuangMinh0504 commented 2 months ago

Javascript treat 0 as Falsey. So when the height of surface array is 0, it was actually 999. For example, the result of console.log(0 || 999) will be 999. I fix by using Nullish coalescing operator (??) instead.

GregoryCannon commented 1 month ago

Wow, nice find!