-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbin.mjs
More file actions
37 lines (33 loc) · 1.09 KB
/
bin.mjs
File metadata and controls
37 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { ElizaBot } from './elizabot.mjs'
/**
*
* @param output
*/
export function print_eliza_logo(output = console.log) {
output('Welcome to')
output(' EEEEEE LL IIII ZZZZZZZ AAAAA ')
output(' EE LL II ZZ AA AA')
output(' EEEEE LL II ZZZ AAAAAAA')
output(' EE LL II ZZ AA AA')
output(' EEEEEE LLLLLL IIII ZZZZZZZ AA AA')
output('')
output('\x1b]8;;https://github.com/steve02081504/ELIZA\x07Eliza\x1b]8;;\x07 is a mock Rogerian psychotherapist.')
output('The original programmed was described by \x1b]8;;https://en.wikipedia.org/wiki/Joseph_Weizenbaum\x07Joseph Weizenbaum\x1b]8;;\x07 in 1964.')
output('This implementation by \x1b]8;;https://github.com/steve02081504\x07Steve02081504\x1b]8;;\x07 2025.')
}
/**
*
*/
export function eliza_main() {
print_eliza_logo()
console.log('')
console.log('')
console.log('')
const eliza = new ElizaBot()
console.log(eliza.getInitialMessage())
while (!eliza.quit) {
const input = prompt('>')
console.log(eliza.transform(input))
}
}
if (import.meta.main) eliza_main()