Re: Object help

2009-01-12 Thread Steve Holden
James Mills wrote: On Mon, Jan 12, 2009 at 9:49 AM, killsto kilian...@gmail.com wrote: Thanks. That makes sense. It helps a lot. Although, you spelled color wrong :P. color colour They are both correct depending on what country you come from :) They are also both incorrect, depending

Object help

2009-01-11 Thread killsto
I have a class called ball. The members are things like position, size, active. So each ball is an object. How do I make the object without specifically saying ball1 = ball()? Because I don't know how many balls I want; each time it is different. The balls are to be thrown in from the outside of

Re: Object help

2009-01-11 Thread Chris Rebert
On Sun, Jan 11, 2009 at 2:06 PM, killsto kilian...@gmail.com wrote: I have a class called ball. The members are things like position, size, active. So each ball is an object. Class names should use CamelCase, so it should be `Ball`, not `ball`. How do I make the object without specifically

Re: Object help

2009-01-11 Thread Jervis Whitley
On Mon, Jan 12, 2009 at 9:06 AM, killsto kilian...@gmail.com wrote: I would think something like: def newball(): x = last_named_ball + 1 ball_x = ball(size, etc) # this initializes a new ball return ball_x But then that would just name a ball ball_x, not ball_1 or ball_2. Is

Re: Object help

2009-01-11 Thread Steven D'Aprano
On Sun, 11 Jan 2009 14:06:22 -0800, killsto wrote: I have a class called ball. The members are things like position, size, active. So each ball is an object. How do I make the object without specifically saying ball1 = ball()? Because I don't know how many balls I want; each time it is

Re: Object help

2009-01-11 Thread killsto
On Jan 11, 2:20 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 11 Jan 2009 14:06:22 -0800, killsto wrote: I have a class called ball. The members are things like position, size, active. So each ball is an object. How do I make the object without specifically

Re: Object help

2009-01-11 Thread James Mills
On Mon, Jan 12, 2009 at 9:49 AM, killsto kilian...@gmail.com wrote: Thanks. That makes sense. It helps a lot. Although, you spelled color wrong :P. color colour They are both correct depending on what country you come from :) Just curious, is there another way? How would I do this in c++

Re: Object help

2009-01-11 Thread Chris Rebert
On Sun, Jan 11, 2009 at 3:49 PM, killsto kilian...@gmail.com wrote: On Jan 11, 2:20 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 11 Jan 2009 14:06:22 -0800, killsto wrote: I have a class called ball. The members are things like position, size, active. So each

Re: Object help

2009-01-11 Thread Terry Reedy
killsto wrote: Just curious, is there another way? How would I do this in c++ which is listless IIRC. If you do not have 0) built-in expandable arrays, as in Python, one can 1) program (or find) the equivalent of Python lists; 2) use linked-lists (as long as one does not need O(1) random

Re: Object help

2009-01-11 Thread John Machin
On Jan 12, 10:49 am, killsto kilian...@gmail.com wrote: On Jan 11, 2:20 pm, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 11 Jan 2009 14:06:22 -0800, killsto wrote: I have a class called ball. The members are things like position, size, active. So each ball is an

Re: Object help

2009-01-11 Thread killsto
Thanks. That makes sense. It helps a lot. Although, you spelled color wrong :P. At this time of day you are likely to find yourself communicating with Australians. Get used to it :-) Cheers, John I was kidding. IMO, we Americans should spell color like everyone else. Heck, use the

Re: Object help

2009-01-11 Thread James Mills
On Mon, Jan 12, 2009 at 2:26 PM, killsto kilian...@gmail.com wrote: I was kidding. IMO, we Americans should spell color like everyone else. Heck, use the metric system too while we are at it. Yes well why don't you start up a rally and convince your brand new shiny government to catch up with