RANDOM_COR=random.randrange(5,6)
def check_xy_data():
global COUNT
COUNT=0
input_xy=input("input(x,y) : ")
think_xy=list(map(int,input_xy.split(",")))
if(random_array[think_xy[0]][think_xy[1]] == "C"):
screen_array[think_xy[0]][think_xy[1]] = "O"
COUNT=COUNT+1
else:
screen_array[think_xy[0]][think_xy[1]] = "X"
def main():
make_intro()
init_screen_array()
init_random_array()
make_random_num(RANDOM_COR)
while(True):
check_xy_data()
draw_outline_start(TOTAL_COL_NUM//2)
draw_out_rowline(TOTAL_COL_NUM//2, "Input : ")
draw_out_rowline(TOTAL_COL_NUM//2, "Correct : ")
draw_out_rowline(TOTAL_COL_NUM//2, "Error : ")
draw_out_rowline(TOTAL_COL_NUM//2, "Total : ")
draw_outline_mid(TOTAL_COL_NUM//2)
if(COUNT==RANDOM_COR-1):
break
The if at the bottom of my code is supposed to get me out of the while loop、but I'm stuck in an infinite loop。 Help?Why does my while loop not stop?
(assignment、2016)予告編The Assignment |語サインベッド監督:ウォルター・ヒル脚本:ウォルター・ヒル、デニスハミル出演:キム・ソンフン出演ヒョンビン、ユ・ヘジン、キム・ジュヒョク開封2016韓国詳細を見るこれまで...
You reset 'COUNT' at the start of every call to' check_xy_data'。 – user2357112
Try printing the variable that you expect to control breaking ... – kabanus
Typically、ALL_CAPS identifiers in Python indicate constants。 Not really cool to be using them for variables you're changing。 –