feat: 초기 프로젝트 설정 및 룰.md 파일 추가

This commit is contained in:
2025-07-28 09:53:31 +09:00
commit 09a4d38512
8165 changed files with 1021855 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
var http = require('http');
var multimeter = require('multimeter');
http.createServer(function (req, res) {
var multi = multimeter(res);
var charm = multi.charm;
var xs = [];
for (var i = 0; i < 100; i++) xs.push(i);
charm.reset()
.write('Calculating the sum of [0..100]:\n\n')
;
var bar = multi(4, 3, { width : 20 });
bar.percent(0);
var sum = 0;
charm.write('\n\nResult: ' + sum);
var iv = setInterval(function () {
var x = xs.shift();
bar.percent(100 - xs.length);
charm
.left(sum.toString().length)
.erase('end')
;
sum += x;
charm.write(sum.toString());
if (xs.length === 0) {
charm.write('\n');
res.end();
}
}, 50);
res.connection.on('end', function () {
multi.destroy();
clearInterval(iv);
});
}).listen(8081);
console.log('curl -N localhost:8081');