ChatGPT - AI explains code in understandable english

This is fun.
https://chat.openai.com/
Here’s what I pasted from my blaster prop and the response it gave:

  void Loop() override {
    PropBase::Loop();
    PollNextAction();
    sound_library_.Poll(wav_player);
    if (wav_player && !wav_player->isPlaying()) wav_player.Free();

    STATE_MACHINE_BEGIN();
    while (true) {
      if (auto_firing_) {
        tmp = GetWavPlayerPlaying(&SFX_auto);
        // Set the length for WavLen<>
        if (tmp) {
          tmp->UpdateSaberBaseSoundInfo();
        } else {
          SaberBase::ClearSoundInfo();
        }
        if (millis() - auto_time_ > 1000 * tmp->length()) {
          shots_fired_++;
          auto_time_ = millis();
          STDOUT << "AUTOFIRING - Remaining shots = " << GetBulletCount() << "\n";
          CheckEmpty();
          if (empty_) {
            SaberBase::DoEndLockup();
            SaberBase::SetLockup(SaberBase::LOCKUP_NONE);
            auto_firing_ = false;
            return;
          }
        }
      }
    YIELD();
    }
    STATE_MACHINE_END();
  }  void Loop() override {
    PropBase::Loop();
    PollNextAction();
    sound_library_.Poll(wav_player);
    if (wav_player && !wav_player->isPlaying()) wav_player.Free();

    STATE_MACHINE_BEGIN();
    while (true) {
      if (auto_firing_) {
        tmp = GetWavPlayerPlaying(&SFX_auto);
        // Set the length for WavLen<>
        if (tmp) {
          tmp->UpdateSaberBaseSoundInfo();
        } else {
          SaberBase::ClearSoundInfo();
        }
        if (millis() - auto_time_ > 1000 * tmp->length()) {
          shots_fired_++;
          auto_time_ = millis();
          STDOUT << "AUTOFIRING - Remaining shots = " << GetBulletCount() << "\n";
          CheckEmpty();
          if (empty_) {
            SaberBase::DoEndLockup();
            SaberBase::SetLockup(SaberBase::LOCKUP_NONE);
            auto_firing_ = false;
            return;
          }
        }
      }
    YIELD();
    }
    STATE_MACHINE_END();
  }

“This code is part of a loop function that is responsible for managing the state of an automatic firing mode in a device, such as a lightsaber soundboard. The loop function checks if automatic firing is currently enabled, and if so, it plays a sound effect for each shot fired and updates the number of remaining shots. It also checks if the device has run out of shots, and if so, it disables the automatic firing mode and performs any necessary cleanup. The code uses a StateMachine object to manage the state transitions and wait for the appropriate time to take a new action. It also uses a wav_player object to play sound effects and a sound_library_ object to manage the available sound effects.”

1 Like

Anyone else terrified by the implications for civilisation that AI tech brings?

2 Likes

Sounds like a great tool for figuring out what code is doing.
(Just beware that it may sound equally convincing when it’s wrong…)

2 Likes

Wow! I’m actually a bit surprised that it recognized this was likely from a lightsaber soundboard

You mean besides being out of a job? Lol

As a writer, yeah. I already know it’s actively stealing my content.

1 Like

And don’t get the artists started here lately either.

Curious, Mech, what do you write?

I write manuals and work as a journalist in the DJ tech industry.

1 Like

Fascinating. I went to school for journalism. I work in education now. Womp womp.

My mother was a teacher and the only piece of career advice she ever gave me was “don’t become a teacher”.

Yeah, smart lady. You can’t beat the schedule, but that’s about the end of it.

Just amazing how this went from some small side thing someone mentioned to me to currently being the fastest growing super popular buzzword out performing Bitcoin and whatever else was popular before that.

It’s becoming increasingly clear that ChatGPT and similar things are hyped completely out of proportion. These chat bots have been trained to produce plausible-sounding things, which are often right, but always presented with an air of authority. There is a show on Netflix called “bullshit”, and I think ChatGPT would win that show hands down.

If there is anything the internet doesn’t need more of, it’s bullshit.

There’s been a lot of rumbling about cheating at the university level, and some of it is turning out to be plausible.

Otherwise, I’d watch that show.

Look how much has happened just since this post lol.
It’s exponential growth…kinda frightening.

GPT-4 is bringing support for images, audio, media etc… as input/output .
And, it’s dropping like this week. crazy.

Speaking of fast, now it’s today.

2 Likes

GPT for president!
(If there was ever a utility for convincing sounding BS, it’s in politics.)

2 Likes

Anyone watching/watched Avenue 5? It’s a great dry/dark comedy about a cruise ship in space. In that universe an AI is the ‘other president’. 2 seasons so far :slight_smile:

I have watched Avenue 5. Really liked it, but didn’t have much hope since the ratings weren’t great. Appreciated that things weren’t dumbed down like so many shows these days. Unfortunately, it has been canceled. Hope someday (soon before the actors age or unable to return) another studio picks it up so we can get a conclusion to the cliffhanger.

I gave chatgpt a try after all of the hype, but was unimpressed. Still a long way from what I would call “intelligence.” In 1991 I used a program called Dr. Sbaitso that came with my sound card. For 32 years later I expected more.

I like to call it Artificial Stupidity.
While it’s relatively easy to tell AI from real intelligence, it’s pretty hard to tell the difference between real and artificial stupidity.