Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860
Entering Starfleet Academy - Huben's Wiki

Entering Starfleet Academy

From Huben's Wiki
Jump to: navigation, search
(Created page with "Spock here. Welcome to Starfleet! Where everybody is sexy, good-looking, healthy, brilliant, able to fight with their fists and has terrible fashion sense. And don't get me st...")
 
Line 57: Line 57:
 
== Recursive Technology ==
 
== Recursive Technology ==
 
Since the days of early Earth Computer Science, recursion has been one of the most powerful tools for mathematics and programming.  The fundamental idea is that a method calculates USING ITSELF.  This is not circular: the logic is that a method breaks a problem into two simpler parts and then calls itself for one or both of those parts.  Such a method could lead to infinite regress, calling itself forever, except that the method must check for when the calculation can stop.  Usually the calculation can stop when it is so simple that no more recursion is needed, or because some limit is reached.
 
Since the days of early Earth Computer Science, recursion has been one of the most powerful tools for mathematics and programming.  The fundamental idea is that a method calculates USING ITSELF.  This is not circular: the logic is that a method breaks a problem into two simpler parts and then calls itself for one or both of those parts.  Such a method could lead to infinite regress, calling itself forever, except that the method must check for when the calculation can stop.  Usually the calculation can stop when it is so simple that no more recursion is needed, or because some limit is reached.
* Uncomment all the lines in recursive().
+
 
 +
We will now change our program so that it draws boxes inside boxes.
 +
* Uncomment the three commented lines in the method recursive().
 
* Run the program and note the difference!
 
* Run the program and note the difference!
*
+
* Method recursive divides the problem of drawing multilple boxes into two pieces.  It draws one box, and then uses itself to draw all the littler boxes inside.  Which statement does which?
 +
* Method recursive would try to make smaller and smaller rectangles forever, except that it stops calling itself  when the boxes get too small. 
 +
** Write an explanation of how it judges that the boxes are too small.
 +
** Test your explanation by changing a line so that it draws multiple boxes, but stops before all the possible boxes are drawn.
 +
 
 +
== Challenges! ==
 +
from concentric
 +
spacing
 +
colors
 +
fibonacci

Revision as of 09:58, 25 October 2012

translate