RubyDubee

  • Archive
  • RSS

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.

    • #game
    • #algorithm
    • #Ruby
  • 8 months ago
  • 13
  • Comments
  • Permalink
  • Share
    Tweet

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!!

    • #algorithm
    • #game
    • #Ruby
  • 2 years ago
  • 1
  • Comments
  • Permalink
  • Share
    Tweet

About

I am Pradyumna and You can read my Rubyish Resume (once it is done) to know more about me!

Pages

  • My Rubyish Resume

Twitter

loading tweets…

I Dig These Posts

See more →
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr