# 출력 결과 저장할 리스트
outBuffer = []
# 공백으로 초기화
for x in range(48):
temList = []
for y in range(48):
temList.append(" ")
outBuffer.append(temList)
def small_star(posX, posY):
for x in range(5):
for y in range(5):
if x == 2 and y == 0:
outBuffer[posX + x][posY + y] = "*"
elif y == 2 and x % 2 == 1:
outBuffer[posX + x][posY + y] = "*"
elif y == 4:
outBuffer[posX + x][posY + y] = "*"
def medium_star(posX, posY):
small_star(posX + 3, posY)
small_star(posX, posY + 6)
small_star(posX + 6, posY + 6)
def large_star(posX, posY):
medium_star(posX + 6, posY)
medium_star(posX, posY + 12)
medium_star(posX + 12, posY + 12)
def print_buffer(buffer):
for x in range(len(buffer)):
for y in range(len(buffer)):
print(buffer[y][x], end = "")
print("")
large_star(12, 0)
large_star(0, 24)
large_star(24, 24)
print_buffer(outBuffer)
'개발자 > Python' 카테고리의 다른 글
Python (파이썬) 깃허브에서 가져오기 (0) | 2020.04.26 |
---|---|
Python (파이썬) Pandas 모듈 (with d6tstack 모듈) (0) | 2020.04.26 |
Python (파이썬) 예외처리 try except (0) | 2020.04.25 |
Python (파이썬) 파이썬 패키지 만들어 배포하기 pypi.org - 1편. 함수 패키지 만들기 (0) | 2020.04.25 |
Python (파이썬) Numpy 모듈 (0) | 2020.04.25 |