-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix.java
More file actions
25 lines (23 loc) · 734 Bytes
/
matrix.java
File metadata and controls
25 lines (23 loc) · 734 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
import java.io.*;
import java.util.*;
public class matrix {
public static void main(String args[]) throws Exception {
BufferedReader letter = new BufferedReader(new InputStreamReader(System.in));
int width = Integer.parseInt(args[0]);
char line[] = new char[width];
Random r = new Random();
while (true) {
for(int x=0;x<line.length;x++)
{
if(r.nextBoolean()){
line[x] = (char)(r.nextInt(26) + 'a'); //got this line from Stack Overflow
}
else{
line[x] = ' ';
}
}
System.out.println(line);
Thread.sleep(50);
}
}
}