Question: # Re-implement the 'mirrorVertical' function to use only # while-loops. Your new function must be called 'mirrorVerticalWhile' # and you must not have any for-loops

# Re-implement the 'mirrorVertical' function to use only # while-loops. Your new function must be called 'mirrorVerticalWhile' # and you must not have any for-loops in your final code. # Then, write a driver to test your new code.

def mirrorVertical(source): width = getWidth(source) mirrorPoint = width/2 for y in range(0,getHeight(source)): for x in range(0,mirrorPoint): leftPixel = getPixel(source,x,y) rightPixel = getPixel(source,width-1-x,y) color = getColor(leftPixel) setColor(rightPixel,color)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!