Editing 1960: Code Golf

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 16: Line 16:
 
The first two functions defined implement “zero” and “successor”, the two basic operations of {{w|Peano axioms|Peano arithmetic}}. Presumably, the programmer will next implement natural number addition, then integers, then whichever branches of mathematics the original problem needs, all from scratch. Generally, you would use built-in functions to perform mathematical operations, so it is redundant to implement them yourself from scratch.
 
The first two functions defined implement “zero” and “successor”, the two basic operations of {{w|Peano axioms|Peano arithmetic}}. Presumably, the programmer will next implement natural number addition, then integers, then whichever branches of mathematics the original problem needs, all from scratch. Generally, you would use built-in functions to perform mathematical operations, so it is redundant to implement them yourself from scratch.
  
The title text suggests that Randall has also invented a reverse version of regular golf, where the aim is to take as many strokes as possible to get the ball in the hole. Similarly to ''Reverse Code Golf'', the only challenge here would be the player's own boredom threshold, since they could always add more strokes by tapping the ball in a direction other than that of the hole.  
+
The title text suggests that Randall has also invented a reverse version of regular golf, where the aim is to take as many strokes as possible to get the ball in the hole. Similarly to ''Reverse Code Golf'', the only challenge here would be the player's own boredom threshold, since they could always add more strokes by tapping the ball in a direction other than that of the hole. Alternatively, he actually plays golf in reverse, starting from the hole (or pin) and hitting the ball towards the tee (he may or may not also be playing in the opposite direction of the hole layout established by the organisation which manages the course). This would however, be a flagrant violation of the Laws and Customs of Golf, as it interferes with other players' games and some aspects are impossible or unpractical (if Randall takes the view that the ball should start in the hole, the rules prohibit using any clubs to remove it in that it would damage the hole, and he would have to putt off the green).
Alternatively, he actually plays golf in reverse, starting from the hole (or pin) and hitting the ball towards the tee (he may or may not also be playing in the opposite direction of the hole layout established by the organisation which manages the course). This would however, be a flagrant violation of the Laws and Customs of Golf, as it interferes with other players' games and some aspects are impossible or unpractical (if Randall takes the view that the ball should start in the hole, the rules prohibit using any clubs to remove it in that it would damage the hole, and he would have to putt off the green).
 
  
 
The comment that he has "been playing for years all across the country and <nowiki>[</nowiki>is] still on the first hole" is ambiguous. Normally, when a golfer says they have been playing all across the country they mean that they have played rounds at many different courses. Randall could be implying the same, but that he's never finished the first hole (which, as noted above, would hardly be surprising), and so still counts it as playing one continuous first hole. Alternatively, he may literally mean that he has been playing the ball continuously across the whole country. Under normal golf rules this would result in his shots going "[https://en.wikipedia.org/wiki/Out_of_bounds#Golf Out of Bounds]" when it went beyond the boundaries of the original course. In one way, this would help him, as he would incur a penalty stroke. However, he would then have to play his next shot from the same spot as the last one, which would hamper him from continuing to play across the country. Since Randall has invented the sport, though, he may have chosen not to include Out of Bounds rules.
 
The comment that he has "been playing for years all across the country and <nowiki>[</nowiki>is] still on the first hole" is ambiguous. Normally, when a golfer says they have been playing all across the country they mean that they have played rounds at many different courses. Randall could be implying the same, but that he's never finished the first hole (which, as noted above, would hardly be surprising), and so still counts it as playing one continuous first hole. Alternatively, he may literally mean that he has been playing the ball continuously across the whole country. Under normal golf rules this would result in his shots going "[https://en.wikipedia.org/wiki/Out_of_bounds#Golf Out of Bounds]" when it went beyond the boundaries of the original course. In one way, this would help him, as he would incur a penalty stroke. However, he would then have to play his next shot from the same spot as the last one, which would hamper him from continuing to play across the country. Since Randall has invented the sport, though, he may have chosen not to include Out of Bounds rules.

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)