kyu_3.line_safari_is_that_a_line package

Submodules

kyu_3.line_safari_is_that_a_line.line_safari module

kyu_3.line_safari_is_that_a_line.line_safari.assert_x_has_rout(grid: list) → bool[source]
kyu_3.line_safari_is_that_a_line.line_safari.line(grid: list) → bool[source]

You are given a grid.

You simply need to return true/false if you can detect a one and only one “valid” line joining those points.

Parameters

grid – which always includes exactly two end-points indicated by X

Returns

true/false

kyu_3.line_safari_is_that_a_line.line_safari.x_counter(grid: list) → int[source]

kyu_3.line_safari_is_that_a_line.test_line_negative module

Testing Line Safari functionality Negative test cases

class kyu_3.line_safari_is_that_a_line.test_line_negative.LineNegativeTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing Line Safari functionality Negative test cases

pytestmark = [Mark(name='skip', args=(), kwargs={'reason': 'The solution is not ready'})]
test_line_negative()[source]

Testing Line Safari functionality Negative test cases

kyu_3.line_safari_is_that_a_line.test_line_positive module

Testing Line Safari functionality Positive test cases

class kyu_3.line_safari_is_that_a_line.test_line_positive.LinePositiveTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing Line Safari functionality Positive test cases

pytestmark = [Mark(name='skip', args=(), kwargs={'reason': 'The solution is not ready'})]
test_line_positive()[source]

Testing Line Safari functionality Positive test cases

kyu_3.line_safari_is_that_a_line.test_walker module

Testing Walker Class

class kyu_3.line_safari_is_that_a_line.test_walker.WalkerClassTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing Walker class

pytestmark = [Mark(name='skip', args=(), kwargs={'reason': 'The solution is not ready'})]
test_starting_position_from_negatives()[source]

Testing Walker class Testing starting position property based on negative grids

test_starting_position_from_positives()[source]

Testing Walker class Testing starting position property based on positive grids

kyu_3.line_safari_is_that_a_line.walker_class module

Walker class: make moves, check directions, etc…

class kyu_3.line_safari_is_that_a_line.walker_class.Walker(grid: list)[source]

Bases: object

Walker class: make moves, check directions, etc…

__count_possible_directions() → int
__get_start_point()

Locate starting point

Returns

starting point X

__reset_direction() → None
__set_direction() → None

Update directions based on current position and previous direction

Returns

None

__set_initial_direction() → dict
__test_down() → bool
__test_left() → bool
__test_right() → bool
__test_up() → bool
property is_done

Check if get to the ‘X’ point or can make one move only

Returns

true/false

move() → None[source]

Make one step if possible

Returns

None

property position

Return char from grid based on current position

Returns

current char

Module contents