This is the last lab I have to deal with before the end of the semester and I'm stuck beyond reason it really is interesting though but...so many exams and I just can't figure it out
1.The program begins by displaying the following picture in a window labeled "Original Picture".
##the picture to work with is this picture http://tinman.cs.gsu.edu/~raj/2010/sp10/lab6.html##
2.#The jpg image is 720x480 in size.
3. Then, the program cuts the image into 6 pieces, each 240x240 in size, and scrambles the six pieces randomly and displays the scrambled image in a separate window labeled "Scrambled Image".
4. Then, the program continually prompts the user for two cell numbers (each cell number ranges from 1 to 6; where cells 1, 2 , and 3 correspond to the 3 images in the first row and cells 4, 5, and 6 correspond to the 3 images in the second row).
Cell number (1-6) to exchange: 1
Cell number (1-6) to exchange: 2
5.If the first cell number entered by the user is 0, the program stops. Otherwise, the program exchanges the the two images at the two cells and displays the altered image in a window labeled "Exchanged Picture".
Please help? all I have so far is
from myro import *
#def moveCell(pic1,cell1,pic2,cell2):
# pic1 and pic2 are the two picture objects and
# cell1 and cell2 are numbers in the range 1..6
# the function moves the image located in cell1
# of pic1 to location cell2 of pic2
#def exchangeCell(pic1,cell1,pic2,cell2):
# pic1 and pic2 are the two picture objects and
# cell1 and cell2 are numbers in the range 1..6
# the function exchanges the images located in cell1
# of pic1 and cell2 of pic2
from myro import *
def moveCell(pic1,cell1,pic2,cell2):
pic1 = "atlantaBraves.jpg"
pic2 = "atlantaBraves.jpg"
cell1 = range(1,7,1)
cell2 = range(1,7,1)
for i in cell1:
this
that
the other
for i in cell2:
this
that
the other
def exchangeCell(pic1,cell1,pic2,cell2):
pic1 = "atlantaBraves.jpg"
pic2 = "atlantaBraves.jpg"
pixel = getPixel(newPic, x, y)
newpic = makePicture(pic1, pic2, makeColor(R,G,B))
cell1 = range(1,7,1)
cell2 = range(1,7,1)
for x in range(pic1):
for y in range(pic2):
setColor(pixel, white)
repaint(newPic)
def main():
p = makePicture("atlantaBraves.jpg")
show(p, "Original Picture")
moveCell(pic1,cell1,pic2,cell2)
exchangeCell(pic1,cell1,pic2,cell2)
return p