/**
* AI 核心代码,估值1个亿
*/
const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: '我: '
});

rl.prompt();

rl.on('line', (line) => {
  switch (line.trim()) {
    case 'hello':
      console.log('AI:world');
      break;
    default: {
      line = line.replace('吗', '');
      line = line.replace('?', '!');
      line = line.replace('?', '!');
      console.log(`AI:${line}`);
      break;
    }
  }
  rl.prompt();
}).on('close', () => {
  console.log('再见!');
  process.exit(0);
});

AI 测试