Professional Documents
Culture Documents
Minesweeper
Nayotama Pradipta - 13520089
Program Studi Teknik Informatika
Sekolah Teknik Elektro dan Informatika
Institut Teknologi Bandung, Jalan Ganesha 10 Bandung
13520089@std.stei.itb.ac.id
Frequency
function backtrack(input arr, solutions
5
: array, board: Minesweeperboard) →
List of solutions 0
Variable Declaration 0 1 2 3 4 5
Valid : boolean Total Failure
Algorithm
if (length(arr) < squares_left) then Graph 2. Failure Frequency for every 5 boards in intermediate
→ level
else if (sum(arr) > mines_left) then
The graph for intermediate level shifts a little to the right, as
➔ most of the total failure is between 2 and 3 for every 5 puzzles.
else
The success rate of the program is 63%.
choice traversal [0,1]
arr.append(choice)
The same experiment is applied for the hard difficulty with
if sum(arr) = mines_left and
16 by 30 board and 99 mines. The following graph depicts the
len(arr) = squares_left then
distribution of failure for every 5 boards:
valid
checkSolutionValidity(board, arr)
if valid then
Failure Frequency of every 5
solutions.append(arr) boards in Hard level
backtrack (arr, solutions, board)
20
➔ solutions
Frequency
10