-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestAlgs4.java
More file actions
39 lines (33 loc) · 1.38 KB
/
TestAlgs4.java
File metadata and controls
39 lines (33 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/******************************************************************************
* Compilation: javac-algs4 TestAlgs4.java
* Execution: java-algs4 TestAlgs4
* Dependencies: StdDraw.java
* http://introcs.cs.princeton.edu/mac/cover.jpg
*
* Draws a blue bullseye and textbook graphic.
*
******************************************************************************/
import edu.princeton.cs.algs4.StdDraw;
public class TestAlgs4 {
public static void main(String[] args) {
StdDraw.setScale(-1, 1);
StdDraw.clear(StdDraw.BLACK);
StdDraw.setPenColor(StdDraw.WHITE);
StdDraw.square(0, 0, 1);
// write some text
StdDraw.setPenColor(StdDraw.WHITE);
StdDraw.text(0, +0.95, "Hello, world! This is a test Java program.");
// StdDraw.text(0, -0.95, "Close this window to finish the installation.");
// draw the bullseye
StdDraw.setPenColor(StdDraw.BOOK_BLUE);
StdDraw.filledCircle(0, 0, 0.9);
StdDraw.setPenColor(StdDraw.BLACK);
StdDraw.filledCircle(0, 0, 0.8);
StdDraw.setPenColor(StdDraw.BOOK_BLUE);
StdDraw.filledCircle(0, 0, 0.7);
StdDraw.setPenColor(StdDraw.BLACK);
StdDraw.filledCircle(0, 0, 0.6);
// draw a picture of the textbook
StdDraw.picture(0, 0, "cover.jpg", 0.65, 0.80);
}
}