reformat mine-sweeper.js code