Dancing Rook ============ Consider a list of :class:`int` where each number represents a shift of position over the list. Let's define a "dance move" from position ``i`` over a list ``L`` as moving to the position ``i+L[i]``. Thus, dacing over a list ``L`` from a given initial position ``i0`` is doing dance moves starting at ``i0`` until it shifts outside the range of ``L`` (being the range the interval of **valid indexes** of a Python list). Write the following function in the module with the same name (file :file:`dancing_rook.py`): .. py:function:: dancing_rook(L, i0) such that *given* - ``L`` a list o :class:`int` - ``i0`` :class:`int` does two things: - **returns** a list of :class:`int` with all the positions that it "danced over" (including the initial one) - **modifies** ``L`` by assigning a :class:`str` ``'.'`` to all positions traversed by dancing over ``L`` from the initial position ``i0`` until it shifts onto a position whose value has already been changed to '.' or it falls outside the range of ``L``. Per exemple: .. literalinclude:: dancing_rook-test.txt :language: python3 :start-after: --ini :end-before: --fi Doctests are available at the file :download:`dancing_rook-test.txt `.