-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
43 lines (26 loc) · 986 Bytes
/
main.js
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
40
41
42
43
const readline = require('readline');
const { setTimeout } = require('timers');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let i=0;
let queue = true;
let qtime = [1000,2000,3000,4000];
let qtimeran = qtime[Math.floor(Math.random()* qtime.length)];
let custName = ["ali","abu","ahmad","syamil"]
let counter = ["O","0","O","O","O"] ;
while(queue){
if(counter[i]=="O"){
counter[i]=custName[Math.floor(Math.random()* custName.length)];
console.log(counter);
}
else{
counter[i]="O";
setTimeout(()=>{
console.log(counter);
},qtimeran);
};
if (i==5) i = 0;
else i++;
};