blob: 2532bc706da22e0ce28de643ae522d9d759f5ade (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
fs = require 'fs'
sleep = (ms) -> new Promise (resolve) -> setTimeout resolve, ms
fs.readFile '2222.txt', 'utf8', (err, data) ->
throw err if err
words = data.split '\n'
displayWords words
displayWords = async (words) ->
for word in words
if word.trim()
process.stdout.write "\x1Bc" # Clear the screen
console.log word
await sleep 603.9604
|