spawnSync输入无法正常工作(想要输入数组)

问题描述 投票:1回答:1

我的代码:

const { spawnSync } = require('child_process');
let child
child = spawnSync('brainfuck', ['-e', '>,[>,]<[.<]'], { input: 'hello' })
console.log('stdout ', child.stdout);
console.log('stdin', child.stdin);
console.log('error', child.error);

github代码:https://github.com/fabianishere/brainfuck这个脑力激荡的代码将'hello'转换为'olleh',但是每次代码只能捕获1个输入,我需要一个字符串数组:'h''e''l''l'o',以^ @结尾(空值)。我该怎么办?

node.js interpreter brainfuck
1个回答
0
投票

{输入:'h \ ne \ nl \ nl \ no'}

© www.soinside.com 2019 - 2024. All rights reserved.