Module: GamesAndRpgParadise::Minesweeper
- Defined in:
- lib/games_and_rpg_paradise/games/minesweeper/constants.rb,
lib/games_and_rpg_paradise/games/minesweeper/grid_placer.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/cli.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/game.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/error.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/field.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/intro.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/generator.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/default_decorator.rb,
lib/games_and_rpg_paradise/games/minesweeper/terminal/default_randomiser.rb
Overview
GamesAndRpgParadise::Minesweeper
Defined Under Namespace
Modules: Terminal Classes: GridPlacer
Constant Summary collapse
- DIMENSION =
#
GamesAndRpgParadise::Minesweeper::DIMENSION
#
10
- BUTTON_BASE_DIMENSION =
#
GamesAndRpgParadise::Minesweeper::BUTTON_BASE_DIMENSION
#
28
- MINESWEEPER_IMG_DIR =
#
GamesAndRpgParadise::Minesweeper::MINESWEEPER_IMG_DIR
#
"#{::GamesAndRpgParadise::PROJECT_BASE_DIRECTORY}images/"
- BASE_IMG_DIR =
#
GamesAndRpgParadise::Minesweeper::BASE_IMG_DIR
#
"#{MINESWEEPER_IMG_DIR}symbols/"
- NUMBERS_IMG_DIR =
#
GamesAndRpgParadise::Minesweeper::NUMBERS_IMG_DIR
#
"#{MINESWEEPER_IMG_DIR}numbers/"
- FLAGS_IMG_DIR =
#
GamesAndRpgParadise::Minesweeper::FLAGS_IMG_DIR
#
"#{MINESWEEPER_IMG_DIR}flags/"
- FACES_IMG_DIR =
#
GamesAndRpgParadise::Minesweeper::FACES_IMG_DIR
#
"#{MINESWEEPER_IMG_DIR}faces/"
- HAPPY_SMILEY_FACE =
#
HAPPY_SMILEY_FACE
#
"#{FACES_IMG_DIR}face-smile.png"
- SAD_SMILEY_FACE =
#
GamesAndRpgParadise::Minesweeper::SAD_SMILEY_FACE
#
"#{FACES_IMG_DIR}face-sad.png"
Class Method Summary collapse
-
.grid(hash = { n_mines: 20, n_fields: 400 }) ⇒ Object
# === GamesAndRpgParadise::Minesweeper.grid.
-
.image_dir ⇒ Object
# === GamesAndRpgParadise::Minesweeper.image_dir ========================================================================= #.
Class Method Details
.grid(hash = { n_mines: 20, n_fields: 400 }) ⇒ Object
#
GamesAndRpgParadise::Minesweeper.grid
Usage example:
x = GamesAndRpgParadise::Minesweeper.grid(n_mines: 20, n_fields: 100)
#
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/games_and_rpg_paradise/games/minesweeper/grid_placer.rb', line 371 def self.grid( hash = { n_mines: 20, n_fields: 400 } ) _ = GamesAndRpgParadise::Minesweeper::GridPlacer.new { :do_not_run_yet } hash.each_pair {|key, value| case key # ======================================================================= # # === :n_mines # ======================================================================= # when :n_mines _.set_n_mines(value) # ======================================================================= # # === :n_fields # ======================================================================= # when :n_fields _.set_n_fields(value) end } _.run return _ end |
.image_dir ⇒ Object
#
GamesAndRpgParadise::Minesweeper.image_dir
#
62 63 64 |
# File 'lib/games_and_rpg_paradise/games/minesweeper/constants.rb', line 62 def self.image_dir MINESWEEPER_IMG_DIR end |