class AdventOfCode2021::Day23::Burrow

Included Modules

Defined in:

day23/day23.cr

Constructors

Class Method Summary

Instance Method Summary

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) #

[View source]
def self.new(str : String) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.energy_of(amp : UInt8) #

[View source]
def self.hallway_index_to_room(h : Int32) : Int32 #

[View source]
def self.is_entry?(h : Int32) : Bool #

[View source]
def self.is_not_entry?(h : Int32) : Bool #

[View source]
def self.room_index_to_hallway(r : Int32) : Int32 #

[View source]

Instance Method Detail

def clone #

[View source]
def hallway : StaticArray(UInt8, 11) #

[View source]
def min_energy : Int32 | Nil #

[View source]
def move_amp_h2r(from_idx : Int32, to_idx : Int32) #

move amp from hallway to room


[View source]
def move_amp_r2h(from_idx : Int32, to_idx : Int32) #

move amp from room to hallway


[View source]
def print_snapshots #

[View source]
def room_size : Int32 #

[View source]
def rooms : StaticArray(AdventOfCode2021::Day23::Room, 4) #

[View source]
def snapshot : Burrow | Nil #

shapshot is for debugging.


[View source]
def solutions : Hash(String, AdventOfCode2021::Day23::Burrow) #

[View source]
def solve : Int32 | Nil #

[View source]
def solved? : Bool #

[View source]
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>

[View source]
def used_energy : Int32 #

[View source]