Difference between revisions of "Talk:1188: Bonding"
(add interpretation comments.) |
|||
Line 1: | Line 1: | ||
The aim method results in an infinite loop/stack overflow, note that ball is an exception of type Ball. This results in a logical flow of aim, "throw," "catch," repeat, though this is only logical by word choice, and is nonsensical from a programming perspective. | The aim method results in an infinite loop/stack overflow, note that ball is an exception of type Ball. This results in a logical flow of aim, "throw," "catch," repeat, though this is only logical by word choice, and is nonsensical from a programming perspective. | ||
− | Pretty sure the code is also intentionally hard to follow. | + | Pretty sure the code is also intentionally hard to follow. {{unsigned|108.48.215.61}} |
Line 8: | Line 8: | ||
Then calling aim with a ball will call the others aim with the ball, which will call the firsts aim with the ball. Etc etc. | Then calling aim with a ball will call the others aim with the ball, which will call the firsts aim with the ball. Etc etc. | ||
− | I guess after about a 1000 aims the jvm will throw you out, stating stack overflow, and the bonding game is over. | + | I guess after about a 1000 aims the jvm will throw you out, stating stack overflow, and the bonding game is over. {{unsigned|212.214.117.162}} |
Revision as of 07:05, 20 March 2013
The aim method results in an infinite loop/stack overflow, note that ball is an exception of type Ball. This results in a logical flow of aim, "throw," "catch," repeat, though this is only logical by word choice, and is nonsensical from a programming perspective.
Pretty sure the code is also intentionally hard to follow. -- 108.48.215.61 (talk) (please sign your comments with ~~~~)
The try/catch parts are just for show, they cancel each other out.
The structure is that you have a parent and a child instance (of class P), each has a 'target' pointed to the other.
Then calling aim with a ball will call the others aim with the ball, which will call the firsts aim with the ball. Etc etc.
I guess after about a 1000 aims the jvm will throw you out, stating stack overflow, and the bonding game is over. -- 212.214.117.162 (talk) (please sign your comments with ~~~~)