Mar-06-2019, 06:22 PM
Hello, I'm new to here and to python. I've till midnight tonight to finish this assignment to make a dozen houses of different shapes and sizes, but I cannot figure this out at all. I have the first house completed, but no matter what I try the second house always overlaps the first and ruins the whole thing. Can someone please shed some light on this situation? Here's the code I have so far.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
c = makeEmptyPicture( 700 , 500 ) #walls and door addRect(c, 20 * 1 + 4 , 40 * 1 + 3 , 60 * 1 , 59 * 1 ) addRect(c, 45 * 1 + 4 , 80 * 1 + 3 , 10 * 1 , 19 * 1 ) #roof addLine(c, 0 + 4 , 40 * 1 + 3 , 50 * 1 + 4 , 0 + 3 ) addLine(c, 50 * 1 + 4 , 0 + 3 , 100 * 1 + 4 , 40 * 1 + 3 ) addLine(c, 0 + 4 , 40 * 1 + 3 , 100 * 1 + 4 , 40 * 1 + 3 ) #windows addRect(c, 25 * 1 + 4 , 60 * 1 + 3 , 9 * 1 , 19 * 1 ) addLine(c, 25 * 1 + 4 , 70 * 1 + 3 , 34 * 1 + 4 , 70 * 1 + 3 ) addLine(c, 30 * 1 + 4 , 60 * 1 + 3 , 30 * 1 + 4 , 79 * 1 + 3 ) addRect(c, 65 * 1 + 4 , 60 * 1 + 3 , 9 * 1 , 19 * 1 ) addLine(c, 65 * 1 + 4 , 70 * 1 + 3 , 74 * 1 + 4 , 70 * 1 + 3 ) addLine(c, 70 * 1 + 4 , 60 * 1 + 3 , 70 * 1 + 4 , 79 * 1 + 3 ) show(c) |