Trying to make a javascript application that mimics minesweeper