Visualize MergeSort in Python
问题 I want to make a mergesort visualizer in python. I want to use turtle module. To draw a single bar i use the function draw_bar, and to draw the entire array there is the function draw_bars. Here is the code def draw_bar(x,y,w,h): turtle.up() turtle.goto(x,y) turtle.seth(0) turtle.down() turtle.begin_fill() turtle.fd(w) turtle.left(90) turtle.fd(h) turtle.left(90) turtle.fd(w) turtle.left(90) turtle.fd(h) turtle.left(90) turtle.end_fill() def draw_bars(v,currenti=-1,currentj=-1,M=500): turtle