Python Forum
maze pattern - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: maze pattern (/thread-4689.html)



maze pattern - angelbest4 - Sep-03-2017

Hello I am a newbie to python and using python 3.
I wish to learn patterns and printing e.g stars etc. I want to make maze pattern but i confused to make maze no 2-no4
No 1:
@ @@@@@@@@@@@@@
@ @
@@@@@@@@@@@@@ @
@ @
@ @@@@@@@@@@@@@
@ @
@@@@@@@@@@@@@ @
@ @
@ @@@@@@@@@@@@@
@ @
@@@@@@@@@@@@@ @
@ @
@ @@@@@@@@@@@@@
@ @
@@@@@@@@@@@@@ @

No 2:
@ @@@@@@@@@@@@@
@ @ @
@ @ @@@@@@@@@ @
@ @ @ @ @
@ @ @ @@@@@ @ @
@ @ @ @ @ @ @
@ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @
@ @ @ @@@ @ @ @
@ @ @ @ @ @
@ @ @@@@@@@ @ @
@ @ @ @
@ @@@@@@@@@@@ @
@ @
@@@@@@@@@@@@@@@

No 3:
@ @@@@@@@@@@@@@
@ @ @ @ @
@ @ @ @ @ @ @@@
@ @ @ @ @ @ @
@ @ @ @ @ @@@ @
@ @ @ @ @ @
@ @ @ @ @@@@@@@
@ @ @ @ @
@ @ @ @@@@@@@ @
@ @ @ @
@ @ @@@@@@@@@@@
@ @ @
@ @@@@@@@@@@@ @
@ @
@@@@@@@@@@@@@@@

No 4:
@ @@@@@@@@@@@@@
@ @ @
@ @ @@@@@@@@@ @
@ @ @ @ @
@ @ @ @@@@@ @ @
@ @ @ @ @ @ @
@ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @
@ @ @ @ @ @ @
@ @ @@@@@ @ @ @
@ @ @ @ @
@ @@@@@@@@@ @ @
@ @ @
@@@@@@@@@@@@@ @


This is my code maze no1:
def SimpleMaze(S):
bool=1
for i in range(S):
if (i+1)%2==0:
print('@'+' '*(S-2)+'@')
else:
if bool==1:
print('@'+' '+'@'*(S-2))
else:
print('@'*(S-2)+' '+'@')
bool=not bool
S= input("Nilai S:")
SimpleMaze(int(S))


RE: maze pattern - Larz60+ - Sep-03-2017

please re-post preserving indentation (post using BBCODE and paste code using shift-ctrl-v)