class AdventOfCode2021::Day23::Burrow
- AdventOfCode2021::Day23::Burrow
- Reference
- Object
Included Modules
Defined in:
day23/day23.crConstructors
- .new(hallway : StaticArray(UInt8, 11), rooms : StaticArray(AdventOfCode2021::Day23::Room, 4), room_size : Int32, solutions : Hash(String, AdventOfCode2021::Day23::Burrow), snapshot)
- .new(str : String)
- .new
Class Method Summary
- .energy_of(amp : UInt8)
- .hallway_index_to_room(h : Int32) : Int32
- .is_entry?(h : Int32) : Bool
- .is_not_entry?(h : Int32) : Bool
- .room_index_to_hallway(r : Int32) : Int32
Instance Method Summary
- #clone
- #hallway : StaticArray(UInt8, 11)
- #min_energy : Int32 | Nil
-
#move_amp_h2r(from_idx : Int32, to_idx : Int32)
move amp from hallway to room
-
#move_amp_r2h(from_idx : Int32, to_idx : Int32)
move amp from room to hallway
- #print_snapshots
- #room_size : Int32
- #rooms : StaticArray(AdventOfCode2021::Day23::Room, 4)
-
#snapshot : Burrow | Nil
shapshot is for debugging.
- #solutions : Hash(String, AdventOfCode2021::Day23::Burrow)
- #solve : Int32 | Nil
- #solved? : Bool
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #used_energy : Int32
Instance methods inherited from module AdventOfCode2021::Day23
is_type?(t : UInt8) : Bool
is_type?,
main
main
Constructor Detail
def self.new(hallway : StaticArray(UInt8, 11), rooms : StaticArray(AdventOfCode2021::Day23::Room, 4), room_size : Int32, solutions : Hash(String, AdventOfCode2021::Day23::Burrow), snapshot)
#
Class Method Detail
Instance Method Detail
def to_s(io : IO) : Nil
#
Description copied from class Reference
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>