Below is the syntax highlighted version of Dragon.java
from §1.5 Input and Output.
/****************************************************************************** * Compilation: javac Dragon.java * Execution: echo F F | java Dragon | java Dragon | java Dragon * Dependencies: StdOut.java StdIn.java * * Prints the instructions for drawing a dragon curve of orders N * using piping. * * % 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(); StdOut.print(dragon + "L" + nogard); StdOut.print(" "); StdOut.print(dragon + "R" + nogard); StdOut.println(); } }