kyu_5.directions_reduction package

Submodules

kyu_5.directions_reduction.directions_reduction module

kyu_5.directions_reduction.directions_reduction.dirReduc(arr: list) → list[source]

A function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed (W<->E or S<->N side by side).

The Haskell version takes a list of directions with data Direction = North | East | West | South.

The Clojure version returns nil when the path is reduced to nothing.

The Rust version takes a slice of enum Direction {NORTH, SOUTH, EAST, WEST}. :param arr: :return:

kyu_5.directions_reduction.test_directions_reduction module

class kyu_5.directions_reduction.test_directions_reduction.DirectionsReductionTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing dirReduc function

test_directions_reduction()[source]

Test a function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed (W<->E or S<->N side by side).

The Haskell version takes a list of directions with data Direction = North | East | West | South.

The Clojure version returns nil when the path is reduced to nothing.

The Rust version takes a slice of enum Direction {NORTH, SOUTH, EAST, WEST}. :return:

Module contents