Class: PuzzleGenerator::ChainedMap
- Inherits:
-
Object
- Object
- PuzzleGenerator::ChainedMap
- Includes:
- DisplayMap, MapUtils
- Defined in:
- lib/puzzle_generator/chained_map.rb
Overview
-
put a chain
-
destroy a chain by chain
-
choose a position by last map
-
-
choose a direct from 3 direct (memo p+d)
-
-
check if the position + direct is ok? ok pass, failed choose again
-
-
goto 2
-
Instance Attribute Summary collapse
-
#maps ⇒ Object
readonly
Returns the value of attribute maps.
-
#option ⇒ Object
readonly
Returns the value of attribute option.
Attributes included from DisplayMap
Instance Method Summary collapse
-
#initialize(option = {}) ⇒ ChainedMap
constructor
A new instance of ChainedMap.
Methods included from DisplayMap
Methods included from MapUtils
#check_answer_correctness, #check_down_chain, #check_left_chain, #check_right_chain, #check_up_chain, #combine_map, #destory_chains, #do_check_chain, #drop_blocks, #make_map_array, #resolve_map
Constructor Details
#initialize(option = {}) ⇒ ChainedMap
Returns a new instance of ChainedMap.
24 25 26 27 28 29 30 |
# File 'lib/puzzle_generator/chained_map.rb', line 24 def initialize option = {} @option = DefaultOption.merge option raise_if_bad_argument init_map @result_map = begin next_level until @maps.size >= @option[:level]; put_fire_point rescue GenerationFailed; $! end end |
Instance Attribute Details
#maps ⇒ Object (readonly)
Returns the value of attribute maps.
23 24 25 |
# File 'lib/puzzle_generator/chained_map.rb', line 23 def maps @maps end |
#option ⇒ Object (readonly)
Returns the value of attribute option.
23 24 25 |
# File 'lib/puzzle_generator/chained_map.rb', line 23 def option @option end |