Game of life in Ruby
Here is the code, I think this needs to be written in more stylish way. If you have any suggestions please comment.
Minesweeper board generator.
Have you ever played Minesweeper? This cute little game comes with a certain operating system whose name we can’t remember. The goal of the game is to find where all the mines are located within a M × N field.
The game shows a number in a square which tells you how many mines there are adjacent to that square. Each square has at most eight adjacent squares. The 4 × 4 field on the left contains two mines, each represented by a “*” character. If we represent the same field by the hint numbers described above, we end up with the field on the right:
* . . . * 1 0 0
. . . . 2 2 1 0
. * . . 1 * 1 0
. . . . 1 1 1 0
Solved this Problem check it out here.All you have to do is checkout the Minesweeper folder and ruby the main.rb file.
See ya!!