Skip to content

Instantly share code, notes, and snippets.

@dvrajan
Last active October 7, 2015 09:49
Show Gist options
  • Save dvrajan/03c5bf03d796b41fc7e2 to your computer and use it in GitHub Desktop.
Save dvrajan/03c5bf03d796b41fc7e2 to your computer and use it in GitHub Desktop.

Revisions

  1. dvrajan revised this gist Oct 7, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Minesweeper
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    There is a mine grid of size nxn and the mine positions are known by the system. Now, Given a coordinate display the mine grid. If a mine is hit, End the game else continue the game until all the cells are opened.
    There is a mine grid of size mxn and the mine positions are known by the system. Now, Given a coordinate display the mine grid. If a mine is hit, End the game else continue the game until all the cells are opened.

    Input => 3 3 // mine of size 5 x 5
    Input => 3 3 // mine of size 3 x 3
    Input => 12 23 33 // mines are at (1,2) (2,3) (3,3)
    Output => x x x
    x x x
  2. dvrajan revised this gist Oct 6, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Minesweeper
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,9 @@ Output => o x x
    .
    .
    .

    Output => o x x
    o o x
    o o x
    Input => 1,3
    Output => o x o
    o o x
  3. dvrajan created this gist Oct 6, 2015.
    33 changes: 33 additions & 0 deletions Minesweeper
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    There is a mine grid of size nxn and the mine positions are known by the system. Now, Given a coordinate display the mine grid. If a mine is hit, End the game else continue the game until all the cells are opened.

    Input => 3 3 // mine of size 5 x 5
    Input => 12 23 33 // mines are at (1,2) (2,3) (3,3)
    Output => x x x
    x x x
    x x x

    Input => 1,1
    Output => o x x
    x x x
    x x x

    Input => 2,2
    Output => o x x
    x o x
    x x x

    .
    .
    .

    Input => 1,3
    Output => o x o
    o o x
    o o x
    Output => You won!

    Input => 1,2
    Output => o x x
    x o x
    x x x
    Output => You hit a mine. Game over!