-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDragon.java
More file actions
29 lines (26 loc) · 854 Bytes
/
Dragon.java
File metadata and controls
29 lines (26 loc) · 854 Bytes
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
/*************************************************************************
* Compilation: javac Dragon.java
* Execution: echo F F | java Dragon | java Dragon | java Dragon
*
* Prints the instructions for drawing a dragon curve of orders N.
*
* % echo F F | java Dragon
* FLF FRF
*
* % echo F F | java Dragon | java Dragon
* FLFLFRF FLFRFRF
*
* % echo F F | java Dragon | java Dragon | java Dragon
* FLFLFRFLFLFRFRF FLFLFRFRFLFRFRF
*
*************************************************************************/
public class Dragon {
public static void main(String[] args) {
String dragon = StdIn.readString();
String nogard = StdIn.readString();
System.out.print(dragon + "L" + nogard);
System.out.print(" ");
System.out.print(dragon + "R" + nogard);
System.out.println();
}
}