Open Sidebar
Close Sidebar
CrystalDoc.info
Source code
Shards.info
toy_robot_crystal
main
ToyRobot
CLI
Command
Base
Move
Place
Report
Rotate
RotateDirection
Commander
NotPlaced
OutsideOfTable
Robot
Direction
Table
UnrecognisedCommand
WrongDirection
Built with Crystal 1.9.2
2023-10-07 17:30:58 UTC
struct
ToyRobot::Table
ToyRobot::Table
Struct
Value
Object
Defined in:
toy_robot/table.cr
Constant Summary
DEFAULT_HEIGHT
=
5
DEFAULT_WIDTH
=
5
Constructors
.new
(width : Int32 =
DEFAULT_WIDTH
, height : Int32 =
DEFAULT_HEIGHT
)
Instance Method Summary
#fits?
(x : Int32, y : Int32) : Bool
#fits?
(robot : Robot) : Bool
#height
: Int32
#width
: Int32
Constructor Detail
def self.
new
(width : Int32 =
DEFAULT_WIDTH
, height : Int32 =
DEFAULT_HEIGHT
)
#
[
View source
]
Instance Method Detail
def
fits?
(x : Int32, y : Int32) : Bool
#
[
View source
]
def
fits?
(robot :
Robot
) : Bool
#
[
View source
]
def
height
: Int32
#
[
View source
]
def
width
: Int32
#
[
View source
]