-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathct
executable file
·39 lines (38 loc) · 1.85 KB
/
ct
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
#!/usr/bin/env -S java --class-path lib/jlayer-1.0.1.jar --source 11
/**\
|****|
\**/
//\\
//||\\
//||||\\
//||||||\\
//||||||||\\
//||||||||||\\
//||********||\\
//|||* Java *|||\\
//||||********||||\\
//||||||||||||||||||\\
//||||||||||||||||||||\\
package christmas; import
java.io.*;import java.util.*;
import java.nio.file.*; import
javazoom.jl.player.Player; public
final class ChristmasTree { public
static void main(String[] arg) throws
IOException { playMusic(); printTree();
} public static void playMusic(){Runnable
songThread = ()->{ try {BufferedInputStream
buffer = new BufferedInputStream ( new
FileInputStream("./x.mp3"));Player player = new
Player(buffer);player.play();} catch(Exception e)
{System.out.println(e) ; } }; Thread t = new Thread
(songThread);t.start();}public static void printTree(
) throws IOException { Path filePath = Paths.get(System
.getProperty ("user.dir" ),"ct" ); List <String> allLines
= Files.readAllLines
(filePath);allLines.
remove(0);for(String
line : allLines ) {
System.out.println (line); try { Thread
.sleep(500);}catch(InterruptedException
e ){} /* */ } System.exit(0); /* */ } }