[Tutor] Fwd: circular movement in pygame

Alan Gauld alan.gauld at btinternet.com
Wed Apr 29 10:26:39 CEST 2015


On 29/04/15 09:03, diliup gabadamudalige wrote:
> Thank you Alan. Understood. I already knew that. My question is
>
> How to to do it the second way.
> some code = what?
>
The point is you cannot do it.
The second approach always uses the current value of x.
The first approach may or may not use the current value
of x. If it does not use x then the += style cannot be
made to work (unless you tag a -x on at the end!

x = 42

x += 42-x

Which is just stupid.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list