-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlowingLetters.java
More file actions
24 lines (23 loc) · 1.03 KB
/
FlowingLetters.java
File metadata and controls
24 lines (23 loc) · 1.03 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
// YouTubeで昔多分流行っていたスクロールすると文字が流れるように見えるものを生成します
// 使い方
// コンパイルできたらjava FlowingLetters <対象の文字列> <間隔数(0に近いほど動かすとなめらかになります)> <繰り返す回数>
public class FlowingLetters{
public static void main(String[] args) {
String target = args[0];
int intervalNum = Integer.parseInt(args[1]);
int repeatNum = Integer.parseInt(args[2]);
StringBuilder interval = new StringBuilder();
for (int i = 0; i < intervalNum; i++){
interval.append(" ");
}
StringBuilder sb = new StringBuilder();
sb.append(target);
System.out.println(sb.toString());
for (int i = 0; i < repeatNum - 1; i++){
System.out.println(sb.insert(0, interval).toString());
}
for (int i = 0; i < repeatNum - 1; i++){
System.out.println(sb.delete(0, intervalNum));
}
}
}