I need to print to stdout (but next step is print to file) an array of strings, containing the info to build-up a shape. Below, the for loop:
for i in range(0, xMax):
for j in range(0, yMax):
print arena_shape[ j + i*yMax]
print('\r')
The array arena_shape[] contains the chars to built-up a 2D figure, figure with i = [0, xMax] rows and j = [0, yMax] columns. I expect the output to be :
i=0 ---------- ------
i=1 | |
| |
| |
| |
| |
| |
i=xMax --------------------
instead to get the first line (i=0, j=[0,yMax])
in "horizontal" as I would expect, I get it displayed in vertical, even if I tell python to \r
only when changing row i
and not at each column j
i=0 -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
I don't understand why this is not changing line after the print("\r")
instruction.
Thank you in advance for the help.