From 04ffd2ceede712a8ca41b47844859e3d76a2c794 Mon Sep 17 00:00:00 2001 From: Fred Z Date: Fri, 9 Feb 2018 17:23:10 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20methode=20map=5Fprint()|TP=5F3.9|UPDATE?= =?UTF-8?q?=C2=A0map.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roboc/map.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roboc/map.py b/roboc/map.py index 4331c0a..9c88a72 100644 --- a/roboc/map.py +++ b/roboc/map.py @@ -18,9 +18,17 @@ class Map: :Example: >>> MyMap = Map("cartes/test.txt") - >>> print(MyMap) + + >>> type(MyMap._data_text) + >>> MyMap.map_print() + O1234 + abcde + ABCDE + zyxwv + + """ def __init__(self, map_file): @@ -50,17 +58,9 @@ class Map: line -= 1 - - def __repr__(): - """ Affichage de la carte, via print() """ - return map_print(self) - - def __str__(): - """ Affichage de la carte, via str() """ - return map_print(self) - def map_print(self): """ Affiche la carte avec la position de jeu courante """ + print(self._data_text) def move_on_map(self, start, move): """