Skip to content

Commit 4ac9bd5

Browse files
author
root
committed
Updated from Central
1 parent a2a8aa1 commit 4ac9bd5

3 files changed

Lines changed: 181 additions & 92 deletions

File tree

.gitattributes

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Java sources
2+
*.java text diff=java
3+
*.gradle text diff=java
4+
*.gradle.kts text diff=java
5+
6+
# These files are text and should be normalized (Convert crlf => lf)
7+
*.css text diff=css
8+
*.df text
9+
*.htm text diff=html
10+
*.html text diff=html
11+
*.js text
12+
*.jsp text
13+
*.jspf text
14+
*.jspx text
15+
*.properties text
16+
*.tld text
17+
*.tag text
18+
*.tagx text
19+
*.xml text
20+
21+
# These files are binary and should be left untouched
22+
# (binary is a macro for -text -diff)
23+
*.class binary
24+
*.dll binary
25+
*.ear binary
26+
*.jar binary
27+
*.so binary
28+
*.war binary
29+
*.jks binary
30+
31+
*.tif binary
32+
*.tiff binary
33+
*.wbmp binary
34+
*.webp binary
35+
36+
# Audio
37+
*.kar binary
38+
*.m4a binary
39+
*.mid binary
40+
*.midi binary
41+
*.mp3 binary
42+
*.ogg binary
43+
*.ra binary
44+
*.wav binary
45+
46+
# Video
47+
*.3gpp binary
48+
*.3gp binary
49+
*.as binary
50+
*.asf binary
51+
*.asx binary
52+
*.avi binary
53+
*.fla binary
54+
*.flv binary
55+
*.m4v binary
56+
*.mng binary
57+
*.mov binary
58+
*.mp4 binary
59+
*.mpeg binary
60+
*.mpg binary
61+
*.ogv binary
62+
*.swc binary
63+
*.swf binary
64+
*.webm binary
65+
66+
# Archives
67+
*.7z binary
68+
*.gz binary
69+
*.jar binary
70+
*.rar binary
71+
*.tar binary
72+
*.zip binary
73+
74+
# Fonts
75+
*.ttf binary
76+
*.eot binary
77+
*.otf binary
78+
*.woff binary
79+
*.woff2 binary
80+
81+
# Executables
82+
*.exe binary
83+
*.pyc binary
84+
85+
# RC files (like .babelrc or .eslintrc)
86+
*.*rc text
87+
88+
# Ignore files (like .npmignore or .gitignore)
89+
*.*ignore text

src/section2/PentagonCrazy.java

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
package section2;
2-
3-
import java.awt.Color;
4-
5-
import org.jointheleague.graphical.robot.Robot;
6-
7-
/* Teacher’s note: before beginning, maybe draw a pentagon and have students work out the angle that the robot will have to turn (360/5) */
8-
9-
public class PentagonCrazy {
10-
public static void main(String[] args) {
11-
12-
// Create a new Robot
13-
14-
// Put the robot's pen down
15-
16-
// SPEED. Make the robot go at maximum speed (100)
17-
18-
// COLOR. Set the pen to a color that you like for the shape
19-
20-
// NUMBER OF SIDES. Make an int variable for the number of sides the shape will have.
21-
// (Hint: its called PentagonCrazy)
22-
23-
// TURN ANGLE. Make another int variable for the angle the robot must turn.
24-
// Hint: Divide 360 by the number of sides the shape has to get the angle.
25-
26-
// COUNT. Make another int variable to count how many times the loop has repeated
27-
// Set its start value to zero.
28-
29-
// LOOP. Start a while loop to repeat the DRAW, TURN, and INCREASE COUNT code 200 times.
30-
31-
// DRAW. Make the robot move "i" pixels
32-
// "i" is the variable in the for loop
33-
34-
// TURN. Turn the robot the amount in your angle variable + 1
35-
36-
// INCREASE COUNT. Increase the loop count by 1
37-
38-
// End the while loop here
39-
40-
// Now hide the robot so you can see the pattern it has drawn.
41-
42-
// Run the program.
43-
// Check the pattern against the picture in the recipe. If it matches, you are done!
44-
45-
46-
47-
// Variations:
48-
// *12. make the pattern really huge
49-
// *13. randomize the color of the pattern
50-
// *14. experiment with different shapes
51-
52-
}
53-
}
1+
package section2;
2+
3+
import java.awt.Color;
4+
5+
import org.jointheleague.graphical.robot.Robot;
6+
7+
/* Teacher’s note: before beginning, maybe draw a pentagon and have students work out the angle that the robot will have to turn (360/5) */
8+
9+
public class PentagonCrazy {
10+
public static void main(String[] args) {
11+
12+
// Create a new Robot
13+
14+
// Put the robot's pen down
15+
16+
// SPEED. Make the robot go at maximum speed (100)
17+
18+
// COLOR. Set the pen to a color that you like for the shape
19+
20+
// NUMBER OF SIDES. Make an int variable for the number of sides the shape will have.
21+
// (Hint: its called PentagonCrazy)
22+
23+
// TURN ANGLE. Make another int variable for the angle the robot must turn.
24+
// Hint: Divide 360 by the number of sides the shape has to get the angle.
25+
26+
// COUNT. Make another int variable to count how many times the loop has repeated
27+
// Set its start value to zero.
28+
29+
// LOOP. Start a while loop to repeat the DRAW, TURN, and INCREASE COUNT code 200 times.
30+
31+
// DRAW. Make the robot move "i" pixels
32+
// "i" is the variable in the for loop
33+
34+
// TURN. Turn the robot the amount in your angle variable + 1
35+
36+
// INCREASE COUNT. Increase the loop count by 1
37+
38+
// End the while loop here
39+
40+
// Now hide the robot so you can see the pattern it has drawn.
41+
42+
// Run the program.
43+
// Check the pattern against the picture in the recipe. If it matches, you are done!
44+
45+
46+
47+
// Variations:
48+
// *12. make the pattern really huge
49+
// *13. randomize the color of the pattern
50+
// *14. experiment with different shapes
51+
52+
}
53+
}

src/section2/Spiral.java

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
package section2;
2-
3-
import org.jointheleague.graphical.robot.Robot;
4-
5-
public class Spiral {
6-
7-
public static void main(String[] args) {
8-
9-
// Create a new Robot
10-
11-
// Set your robot's pen down
12-
13-
// SPEED. Set the robot to go at max speed (100)
14-
15-
// COUNT. Create an int variable that will count how many lines of the spiral we have drawn.
16-
// Start its value as zero.
17-
18-
// LOOP. Start a while loop to repeat the COLOR, DRAW, TURN, and COUNT code below until 50 lines have been drawn
19-
20-
// COLOR. Have the robot set a random pen color: setRandomPenColor()
21-
22-
// DRAW. Move the robot (5*count) pixels
23-
// count is the name of the variable you created earlier
24-
25-
// TURN. Turn the robot (360/7) degrees to the right
26-
27-
// COUNT. Increase the count of how many lines have been drawn so far ( count+=1 )
28-
29-
// Change the robot pen width to the current value of the count variable
30-
31-
32-
// End the while loop here
33-
34-
35-
// Run the program.
36-
// Check the pattern against the picture in the recipe. If it matches, you are done!
37-
38-
}
39-
}
1+
package section2;
2+
3+
import org.jointheleague.graphical.robot.Robot;
4+
5+
public class Spiral {
6+
7+
public static void main(String[] args) {
8+
9+
// Create a new Robot
10+
11+
// Set your robot's pen down
12+
13+
// SPEED. Set the robot to go at max speed (100)
14+
15+
// COUNT. Create an int variable that will count how many lines of the spiral we have drawn.
16+
// Start its value as zero.
17+
18+
// LOOP. Start a while loop to repeat the COLOR, DRAW, TURN, and COUNT code below until 50 lines have been drawn
19+
20+
// COLOR. Have the robot set a random pen color: setRandomPenColor()
21+
22+
// DRAW. Move the robot (5*count) pixels
23+
// count is the name of the variable you created earlier
24+
25+
// TURN. Turn the robot (360/7) degrees to the right
26+
27+
// COUNT. Increase the count of how many lines have been drawn so far ( count+=1 )
28+
29+
// Change the robot pen width to the current value of the count variable
30+
31+
32+
// End the while loop here
33+
34+
35+
// Run the program.
36+
// Check the pattern against the picture in the recipe. If it matches, you are done!
37+
38+
}
39+
}

0 commit comments

Comments
 (0)