My son asked me if I could write a small program so that the ball would bounce around the screen, and then I will explain it. Having marked the neat possibility of fatherhood, I said: "Yes, no problem." So I dug up my python skills and wrote this.
#!/usr/bin/python
I ran the program and was very pleased. However, when the ball hits the edge, it seems to “slip” and does not bounce cleanly.
It is quite late in the evening, so I could not lower my head, and I thought that I would throw it away and see if anyone could explain why. I do not fix the code, I am sure that with <= or> = the tests will work. I just can’t understand what he is doing, what he is doing ...
thanks Mark.
source share