OpenAI & Hollywood

Discuss any general programming issues here
Post Reply
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

OpenAI & Hollywood

Post by nexus »

I was curious and asked in ChatGPT4o for Hollywood
do you know the programming language Hollywood?
And indeed, it does:
ChatGPT
Yes, Hollywood is a programming language designed for multimedia applications. It was originally created for the Amiga computer platform but has since been made available for other systems, including Windows, macOS, Linux, and Android. Hollywood is known for its simplicity and ease of use, making it accessible for creating multimedia-rich applications, games, and presentations.

Key features of Hollywood include:

1. Cross-Platform Development: Write once, run anywhere approach. The same code can run on multiple operating systems without modification.
2. Integrated Development Environment (IDE): Provides a user-friendly environment for writing and testing code.
3. Support for Multiple Media Types: Handles images, audio, video, and text seamlessly.
4. Extensive Libraries: Includes a wide range of built-in functions and libraries for graphics, sound, networking, and more.
5. Scripting Language: Designed to be easy to learn and use, with a syntax similar to BASIC.

If you have any specific questions about Hollywood or need help with something related to it, feel free to ask!
So, I was wondering if chatGPT can speak Hollywood:
Please write an application in Hollywood that shows all photos from a folder as a slideshow.
Surprisingly, I got a reply, and it looks like Hollywood, but I guess is more pure LUA?
At least, some functions like `GetFileType(file)` and `IsFile(file)` seems not to be functions in Hollywood :)
By the way, the `GetFileType(file)` function, I would like to see in Hollywood :)

But anyway, it could help if you are stuck with some problems in Hollywood, too. So, I thought, it's worth sharing :)

Certainly! Here’s a simple example of a Hollywood script that shows all photos from a folder as a slideshow. This script assumes you have Hollywood installed and set up correctly.

Code: Select all

@REQUIRE "hollywood.hwp"

Function p_Main()
    Local photos = {}
    Local folder = "path/to/your/folder"
    Local files = FileRequest("Select a folder", folder, #FILEREQF_MULTISELECT)

    If files
        For Local i = 0 To ListItems(files) - 1
            Local file = GetFileEntry(files, i)
            If file And IsFile(file) And (GetFileType(file) = #FILETYPE_IMAGE)
                InsertItem(photos, file)
            EndIf
        Next
    EndIf

    If ListItems(photos) > 0
        Local screen = OpenDisplay(800, 600, 32, #DISPLAY_WINDOW, "Slideshow")
        Local currentIndex = 0

        Repeat
            Local photo = LoadBrush(Nil, photos[currentIndex])
            DisplayBrush(photo, 0, 0)
            FreeBrush(photo)

            currentIndex = (currentIndex + 1) % ListItems(photos)
            Wait(120)  ; wait for 2 seconds
        Until QuitRequest()
        CloseDisplay(screen)
    Else
        MessageBox("No images found in the selected folder.", "Error")
    EndIf
EndFunction

InstallEventHandler({OnStart = p_Main})
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: OpenAI & Hollywood

Post by jPV »

It may look like Hollywood code at the first look, but it's actually pure non-sense in code-wise.

Lots of non-existing functions as you said, and even the existing functions are using totally wrong arguments. And lots of small issues everywhere, like wrong require line, "If files" is always true because multiselect doesn't return empty variable ever, Wait isn't using seconds but ticks, and so on.

If you don't know these already, you'll have to learn Hollywood from the manual anyway, so it's just useless to start with this kind of script and just read the manual in the first place. And you probably leave many bugs which you don't even think to be a bug when starting with this kind of script (like the If issue).
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: OpenAI & Hollywood

Post by Flinx »

nexus wrote: Tue May 28, 2024 1:32 pm So, I thought, it's worth sharing
Do you know how such an LLM works? It gets its training data from somewhere, and in this case it will mainly be this forum, mixed with other programming forums. As the model continues to be trained, it will read your posting in the next iteration and then provide even more nonsensical answers.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: OpenAI & Hollywood

Post by airsoftsoftwair »

Code looks Hollywood-ish but as jPV said, it's rather nonsense. It even got the Wait() function wrong, passing 120 instead of 100 for 2 seconds. This just confirms my assumption that AI is way too hyped at the moment. If it were really intelligent, it would easily understand from the 1000+ page Hollywood manual that Wait() takes an argument in ticks and 50 ticks are one second so 100 ticks are two seconds. But it doesn't seem to understand the manual at all and just throws random code at you.
Post Reply