User Profile
Collapse
-
I have managed to dorrect the first problem by changing the loop around.. but If someone could help me with the second one please.. -
Circles help please
atlast I have managed to get some working code but the first problem is that I have is taht.. when I call draw(2,4) I have a column of 2 circles and 4 rows and I would actually like it to be a clomun of 2 and row of 4. Secodly although my code works I have a main function and an input for an colour how could I fill the circles with the requested colour?
like
This is what i currently have
00
00
00
... -
for the size of the graphic window.. would it be
size of the window - ((number of circles + 1) * spacing)) / number of circlesLeave a comment:
-
So the length and height are to calculate the size of the graphic window according to the number of circles required? could I use the if and else from the previous code I gave? and do I keep my orignal code and add code to it and remove and add?
thxLeave a comment:
-
yup i kinda understand what a for loop is.. but a bit rusty on python as i am retaking a module and had studied it in sept and just learned java.. what exactly would I have to do? to complete what i want the program to do?
thxLeave a comment:
-
-
sorry i posted in a hurry so none of tht make sense...it works but not the way i want it to.. now it does concentric circles.. but i want it to have seperate circles as i have tried to show below.. any help would be appreciated..
00000(all red)
00000(all white)
00000(all red)
00000(all white)Leave a comment:
-
circle loop?
I am trying to make some code which creates 5 set of circles. But this is the best i could do
00000(all red)
00000(all white)
00000(all red)
00000(all white)
...Code:from graphics import * def main(): win = GraphWin("My Circle", 300, 300) # count backwards for k in range(6, 1, -1): c = Circle(Point(150,150), 20*k) # alternate -
I want 25 circles.. so would the range be
for i in range(25):
but how could I execute the function for it being filled with red or not? I mean the if and else function?Leave a comment:
-
graphics.py circle loop?
how could I loop this to repeat the circles with one circle filled with red colour and one without?
from graphics import *
...Code:w = 300 h = 300 win = GraphWin("Red Circle", w, h) center = Point(150, 150) radius = 80 circle = Circle(center, radius) circle.setFill('red') circle.setWidth(2) circle.draw(win) win.getMouse()
No activity results to display
Show More
Leave a comment: