Files
  • index.js
  • package-lock.json
  • package.json
index.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
const readlineSync = require('readline-sync');


function sleepSort(arr) {
  const sorted = [];
  arr.forEach(elt => {
    setTimeout(() => {
      sorted.push(elt);
    }, elt);
  });
  return sorted;
}

function main() {
  console.log(`Hi! Here are some of the things you can do from this point:
Type ".random [length]" to sort a random list with the length that you input.
Type a few numbers seperated by commas to sort the list you enter.
Type ".exit" to exit the program.`);
  while (true) {
    const input = readlineSync.question('List:');
    if (input.substring(0, 7) === '.random') {
      
    }
  }
}
node v10.15.2 linux/amd64