Skip to content

Commit

Permalink
Uzupełnie tłumaczenia library_documentation rg.
Browse files Browse the repository at this point in the history
  • Loading branch information
xinulsw committed Apr 29, 2015
1 parent 1a220a6 commit b29cc01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/rg/library_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ Zwraca listę położeń sąsiadujących z ``loc``. Jako drugi argument
Dla przykładu: ``rg.locs_around(self.location, filter_out=('invalid', 'obstacle'))``
– poda listę kwadratów, na które można wejść.

.. raw:: html

<hr />

Metoda **rg.toward(current_loc, dest_loc)**
********************************************

Zwraca następne położenie na drodze z bieżącego miejsca do podanego.
Np. poniższy kod:

.. code-block:: python
import rg
class Robot:
def act(self, game):
if self.location == rg.CENTER_POINT:
return ['suicide']
return ['move', rg.toward(self.location, rg.CENTER_POINT)]
– skieruje robota do środka planszy, gdzie popełni on samobójstwo.

.. raw:: html

<hr />
Expand Down

0 comments on commit b29cc01

Please sign in to comment.