Little Language Model: The ELIZA effect

I’m setting up a replica Commodore 64 to try doing this year’s Advent of Code on it, and I have a lot to learn. First challenge: if I have code or puzzle inputs I want to put onto the C64, how do I do that?

Retrogame Start has a helpful guide for this — and links to some classic type-in programs, including ELIZA. I remember this! It tries to emulate a psychiatrist, a chatbot style that’s now very familiar to all of us, but was written in the 1960s at MIT’s Artificial Intelligence Laboratory and needs only 230 lines of Basic. A very tempting candidate for me to try loading onto my C64.

You can try this too if you like! I’ll give instructions for easily setting up an emulator on your laptop, no need to buy new hardware.

Commodore 64 screen with a conversation.

Hello, I'm Eliza. what is your problem?

I need you to solve some advent of code problems for me

We were discussing you - not me.

Will you write code?

Oh, i write code?

Good, yes please. c64 basic.

Say do you have any psychological problems?
I’m planning to solve the puzzles the old fashioned way, but while I had this AI installed I thought I’d ask.

Step by step

I found most of this great advice for loading/saving/copying between a modern machine and a C64 emulator or machine in this Retrogame Start guide.

First, get VICE (the Versatile Commodore Emulator):

  • Get the latest version from the homepage. They recommend the GTK3 version.
  • Extract the zip file and the files you need are in the bin folder: double click on x64sc.exe (or your Mac equivalent) and the C64 welcome screen pops up ready to use!
  • (Not needed now, but you might be interested): There’s also lots of handy command line tools. I copied the whole VICE folder to C:\Program Files and added the path to that bin folder to the Path environment variable, so I can call them all in the terminal or scripts.

A C64 welcome screen, in a window that has a menu bar at the top and various settings for CRT, Joysticks, and things at the bottom.
Emulator opens in a window; it’s Alt-D to go fullscreen.

Next, get the code you want to run:

  • The Retrogame Start guide links to ELIZA code for a different version of BASIC, I found a Commodore version here: https://github.com/timopb/eliza.
  • Download the eliza.bas file.
  • This file’s already using lowercase text, so it’s ready to use — if you find any files in ALL CAPS you need to lowercase them first. Retrogame Start suggests convertcase.net, or you could use an IDE (> Transform to Lowercase in VS Code).
    • Why’s that? C64 uses PETSCII rather than ASCII or utf-8 encoding. The character codes for lowercase letters show as uppercase on the C64, and if you send it uppercase letters they’ll show up as graphical symbols. “Why PETSCII?” is a good question.

Then, you can paste it into your emulator, just as if you’d typed the whole thing in:

  • Select all of the code and paste into VICE with Alt-Insert or with the menu at the top.
  • Type RUN (this’ll appear in uppercase, no need for shift key) and enter to start.
  • For ELIZA, I wasn’t sure how to quit the program when finished! To exit programs you need to press RUN/STOP and RESTORE. The emulator maps these to Escape and Page Up.
    • On my laptop that’s hold esc, fn, and the up arrow (which has pg written on it)

If you want to get the program from the emulator to a TheC64 replica machine like I use, you can save it on a USB stick that gets treated like a C64 disk drive (again, the Retrogame Start guide has that covered!)

Enjoy! The VICE emulator can run any C64 code you paste or type in. It can also load and run any games you find as .d64 disk image files (there are lots available) — use the settings menu to map keys to joystick controls if you don’t have a suitable joystick or controller handy.

The ELIZA effect

When Joseph Weizenbaum created ELIZA at MIT in the 1960s, he was immediately surprised by the strong response some users had to it — despite it being simple and limited, lots of people ascribed intelligence to it and engaged with it as if it had real understanding. This impulse has been named the ELIZA effect and Weizenbaum was alarmed by it; later he was even more alarmed that other researchers were inspired by his “doctor” script and keen to explore using similar tools for real psychotherapy. If you’d like to read more…


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *