0
나는이 효과를 내기 위해 무언가를 재현하려고합니다. 색상은 다양하지 않습니다 - 파이썬 그래픽
import graphics
from graphics import color_rgb
import random
window= graphics.GraphWin("x", 600, 400)
stripes = input("How many stripes should be on the flag")
stripes = int(stripes)
count = 0
count = int(count)
P1=graphics.Point(0,0) #left corner - anchor point
for x in range(stripes): #loop for number of stripes
col= random.randint(1,255)
stepdim = 400/stripes #size of divisions
stepdim = int(stepdim)
shrink = count*stepdim
shrink = int(shrink)
stepdim = stepdim*10 #enlarge to an increment below the last
stepdim = stepdim-shrink
stepdim = int(stepdim)
P2=graphics.Point(600,stepdim) #bottom right corner - ever shrinking
outsiderec=graphics.Rectangle(P1,P2) #
outsiderec.setFill(color_rgb(100, col, 0))
outsiderec.draw(window)
count= count + 1
count= int(count)
window.getMouse()
window.close()
내가 대신 하나 개의 평면 컬러를 수신하고 있습니다.
문제가 내 rand (int)에 있다고 가정합니다. 나는 그것의 내용을 잘 알지 못한다. 한 번 이상 실행되지 않습니까?