Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 javascript 进行简单的文本冒险,我需要一种方法让玩家能够在被要求选择相应的选项时编写 1、2、3 或 4。我该怎么做呢?readline()并且console.read()不工作。
readline()
console.read()
我没有使用网站。我需要它在控制台中。
document.addEventListener('keydown', function(event) { if(event.keyCode == EVENTCODE) { //action } });
在 EVENTCODE 位置编号的位置:
48 = 0 49 = 1 50 = 2 51 = 3 52 = 4 53 = 5 54 = 6 55 = 7 56 = 8 57 = 9,