Hi! there is a matrix
matrix : array[17,array[17,int]]
There's a code that displays a picture
draw =
for y in matrix:
for x in y:
if(x==1): echo("#") else: echo(" ")
output must be like
#####
# #
# # # #
# #
# ### #
#####
but i see this:
#
#
#
#
#
#
#
#
#
#
#
how to make it work correctly ?Echo works correctly in this case - in your case it doesn't work the way you want because you don't need newlines in rows. Your code should be something like this:
proc draw =
for y in matrix:
for x in y:
stdout.write if x==1: "#" else: " "
echo "" # newline