我在一段python代码中发现了这一部分:
score = random.randint(0, 100)
filled_progbar = round(score / 100 * 10)
counter_ = '█' * filled_progbar + ' ' * (10 - filled_progbar)
它在python中看起来很好,但我不知道如何将其放在node.js中。为什么我需要这个从python到node.js?因为我对python是个哑巴,而且我是node.js的新手,所以我在这里问。:)
抱歉,如果我没有选择正确的标签,但我不确定哪个标签是好的。
如果我的研究是正确的,那么分数部分是这样的:
Math.floor(Math.random() * 100);
但我不知道另一部分。
https://stackoverflow.com/questions/51661157
复制相似问题