Jump to content
IGNORED

Wikipedia like engine in ATARI BASIC (by ChatGPT)


Matej

Recommended Posts

Hello.

As little kid I have done my own audio tape atari magazine (atam). But lost source. So I am trying recreate it with ChatGPT. Also add QR codes (links to websites) using PC generation than convert to ATASCII... 

 

So friends here will be place for Your opinion, brainstorm, corrections etc. I am just Pokey musician and pixel artist as kid I was better coder :) than now. But want do simple hypertext engine for Atari memories...

 

ME:
Can You generate simple hypertext system in Atari 800 BASIC programming language?


ChatGPT:
Certainly! Here's an example of how you could create a simple hypertext system in Atari 800 BASIC programming language:

```basic
10 REM *** Hypertext System ***
20 DIM LINK$(5), TARGET$(5)
30 LINK$(1) = "Page2"
40 TARGET$(1) = "Go to Page 2"
50 LINK$(2) = "Page3"
60 TARGET$(2) = "Go to Page 3"
70 LINK$(3) = "Page4"
80 TARGET$(3) = "Go to Page 4"
90 LINK$(4) = "Page5"
100 TARGET$(4) = "Go to Page 5"
110 LINK$(5) = "Page1"
120 TARGET$(5) = "Go back to Page 1"
130 PAGE = 1
140 GOTO 1000

1000 REM *** Page Display ***
1010 PRINT "Welcome to Page "; PAGE
1020 PRINT
1030 PRINT "Choose a link:"
1040 FOR I = 1 TO 5
1050 IF LINK$(I) <> "" THEN PRINT I; ". "; TARGET$(I)
1060 NEXT I
1070 PRINT
1080 INPUT "Enter the link number: ", LINK
1090 IF LINK >= 1 AND LINK <= 5 AND LINK$(LINK) <> "" THEN
1100   TARGET = LINK$(LINK)
1110   PAGE = VAL(MID$(TARGET, 5))
1120   GOTO 1000
1130 ELSE
1140   PRINT "Invalid link number. Please try again."
1150   GOTO 1080
1160 END IF

```

This example demonstrates a basic hypertext system with five pages. Each page has up to five links, represented by the `LINK$()` and `TARGET$()` arrays. The `LINK$()` array stores the target page names, and the `TARGET$()` array stores the displayed link text.

To navigate through the pages, the program starts at line 130, which initializes the `PAGE` variable to 1. Then it jumps to line 1000, which represents the main page display loop. In this loop, the program prints the current page number and displays the available links. It prompts the user to enter a link number and checks if it's valid. If the link is valid, it updates the `PAGE` variable and jumps back to line 1000 to display the new page.

You can customize this code by modifying the number of pages and links, as well as the link texts and target pages. Remember that this example is quite simple and doesn't include features like formatting or more advanced navigation options.

Edited by Matej
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

ME: Can you upgrade the code with a blue background, yellow text, and red links? 

 

ChatGPT:

To upgrade the code with a blue background, yellow text, and red links, you can utilize Atari 800 BASIC's special control codes. Here's the modified code with the desired color scheme:

```basic
10 REM *** Hypertext System ***
20 DIM LINK$(5), TARGET$(5)
30 LINK$(1) = "Page2"
40 TARGET$(1) = "Go to Page 2"
50 LINK$(2) = "Page3"
60 TARGET$(2) = "Go to Page 3"
70 LINK$(3) = "Page4"
80 TARGET$(3) = "Go to Page 4"
90 LINK$(4) = "Page5"
100 TARGET$(4) = "Go to Page 5"
110 LINK$(5) = "Page1"
120 TARGET$(5) = "Go back to Page 1"
130 PAGE = 1
140 GOTO 1000

1000 REM *** Page Display ***
1010 PRINT CHR$(147) + CHR$(66) + CHR$(0) + CHR$(156)
1020 PRINT CHR$(5) + "Welcome to Page "; PAGE
1030 PRINT
1040 PRINT "Choose a link:"
1050 FOR I = 1 TO 5
1060 IF LINK$(I) <> "" THEN PRINT CHR$(3) + CHR$(18) + CHR$(10) + I; ". " + CHR$(19) + TARGET$(I)
1070 NEXT I
1080 PRINT
1090 INPUT "Enter the link number: ", LINK
1100 IF LINK >= 1 AND LINK <= 5 AND LINK$(LINK) <> "" THEN
1110   TARGET = LINK$(LINK)
1120   PAGE = VAL(MID$(TARGET, 5))
1130   GOTO 1000
1140 ELSE
1150   PRINT "Invalid link number. Please try again."
1160   GOTO 1090
1170 END IF

```

In this modified code, the following changes have been made:

- Line 1010: The `CHR$()` function is used to insert special control codes. `CHR$(147)` sets the background color to blue, `CHR$(66)` sets the text color to yellow, `CHR$(0)` clears any text attributes, and `CHR$(156)` resets the colors to the default.
- Line 1020: `CHR$(5)` is used to set the text color to yellow.
- Line 1060: `CHR$(3)` sets the text color to red, `CHR$(18)` represents the inverse video control code (to make the text appear in red), `CHR$(10)` adds a new line, and `CHR$(19)` cancels the inverse video effect for the link text.

These modifications should provide the desired color scheme, with a blue background, yellow text, and red links. Feel free to adjust the color codes as needed or add further enhancements to suit your requirements.

 

At evening will try add QR in ATASCII (probably will do QR on PC and redraw via some tool).

Edited by Matej
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Those "chr" codes are not how you change colours on the Atari.  Also, you cannot have a blue background with yellow text unless you are using a low res graphics or multi-colour text mode, the latter of which will require custom font.

  • Like 2
Link to comment
Share on other sites

55 minutes ago, Stephen said:

Those "chr" codes are not how you change colours on the Atari.  Also, you cannot have a blue background with yellow text unless you are using a low res graphics or multi-colour text mode, the latter of which will require custom font.

Was right now reading and will post it.

Also on atari basic there's no MID$ (it's C64 instead, from wikipedia: "The functions LEFT$, MID$, and RIGHT$ are replaced by string indexing.")

) and ELSE (at least CPC has, C64 I don't remember) maybe some of those VAL,... together also doesn't work...

Nice try anyway for him/her/them... :grin: ;)...

:thumbsup:

Edited by José Pereira
  • Like 2
Link to comment
Share on other sites

I thought part of intelligence was having some grasp on what you can and can't do? Maybe it should read this page: Dunning-Kruger Effect

 

Maybe it doesn't have enough instructional material to learn from. Atari BASIC has only been around for 44 years, and there are probably only several hundred books and thousands of magazine articles on the subject.

 

Maybe it would be helpful if it tried to run its own code first before submitting it as a solution to a request?

 

  • Like 3
Link to comment
Share on other sites

2 hours ago, MrFish said:

I don't recall Atari BASIC having IF-THEN, ELSE-END IF in its vocabulary.

 

Care to try another Atari language ChatGPT?

 

Seems it has some 'general' basic not for a particular machine?

What about you guys try asking that exactly the same for C64, CPC and ZX?

It'll be funny if the answer be exactly the same 😁...

 

P.s.- Yeah! I Also didn't notice END IF, just shot the answer right after the first gafs 🙃...

Edited by José Pereira
  • Like 1
Link to comment
Share on other sites

1 hour ago, José Pereira said:

Seems it has some 'general' basic not for a particular machine?

What about you guys try asking that exactly the same for C64, CPC and ZX?

It'll be funny if the answer be exactly the same 😁...

 

P.s.- Yeah! I Also didn't notice END IF, just shot the answer right after the first gafs 🙃...

Probably some Microsoft BASIC model. So, I guess it would possibly suit C64 better.

 

It shouldn't be claiming it can accommodate a query for Atari 800 BASIC code, though, if it can't. BASIC is probably such a low priority in the programming of its AI that any specific BASIC's of the Atari 8-bit computer era are going to be considered nearly irrelevant -- at least at this stage of development.

 

  • Like 1
Link to comment
Share on other sites

I'm still trying to figure out what is more scary. An intelligent AI or stupid ChatGPT as SkyNet? Either way it'll kill us imperfect humans, one because it deems us inferior and worthless, or two because it simply misunderstands which button = 'Launch All Missiles' because of not knowing which version of Basic is being used :lolblue:

  • Like 2
  • Haha 1
Link to comment
Share on other sites

It could be akin to Atari MicroSoft BASIC I or Atari MicroSoft BASIC II which are official Atari BASIC but it's program still won't work.

They are already using this shit and it's guidance to shape the direction of businesses. We're already in the which button got pressed situation. The doom clock is now jiffies to that long dark never ending midnight.

Edited by _The Doctor__
  • Like 2
  • Confused 1
Link to comment
Share on other sites

AI will be the end of us.  But it won't be in a SkyNet, sentient robots killing us.  This is just the next chapter in the Idiocracy chapter.  People will continue to get dumber and rely more on stupid auto-generated crap until innovation stops, then repairs of existing tech stop.

  • Like 4
Link to comment
Share on other sites

6 hours ago, MrFish said:

It shouldn't be claiming it can accommodate a query for Atari 800 BASIC code, though, if it can't.

Welcome to ChatGPT (and almost all the LLM code generators). "Confidently incorrect" is the term typically used, and ChatGPT supplies it in droves.

In my experimenting around with it I have found ChatGPT to:
1) Regularly produce proper appearing code that will not compile/parse
2) Supply a somewhat-working set of code that does nothing close to what it was asked
3) Completely miss simple logic flow constructs like a case statement in C/C++, and instead if()else if() chain it (and that was with an enum as the input)
4) Get pretty close on an initial attempt and then when supplied correct tweak suggestions to the code, devolve it into a complete mess
5) Supply a set of code, then be fed that exact code back in response with "please find memory bounds issues" in which it identifies several
6) finally, and honestly most damning, often produce code that looks right, compiles, but then fails, requiring painstaking debugging to determine what is going on.

It is occasionally astounding what it can do, but the only way I know of to consistently be productive with ChatGPT and code is to already be a programmer, so you can catch all this and other issues. Which seems to defeat the purpose somewhat.

BTW, it actually does passably well at 6502. Or at least the limited times I've used it for that the code has almost worked or worked.
 

  • Haha 2
Link to comment
Share on other sites

3 hours ago, gnusto said:

5) Supply a set of code, then be fed that exact code back in response with "please find memory bounds issues" in which it identifies several

I find this the most humorous. 

 

3 hours ago, gnusto said:

BTW, it actually does passably well at 6502. Or at least the limited times I've used it for that the code has almost worked or worked.

Maybe not so surprising, since they're still being used in modern devices and assembly would be the default language.

 

Have it write an interrupt-driven ST Mouse driver in 6502 assembly. :D Should be a short enough task, at least.

 

  • Haha 1
Link to comment
Share on other sites

8 hours ago, gnusto said:

It is occasionally astounding what it can do, but the only way I know of to consistently be productive with ChatGPT and code is to already be a programmer, so you can catch all this and other issues. Which seems to defeat the purpose somewhat.

 

I'm not a programmer, so maybe I don't know what to ask it to do, but ChatGPT seems incredibly stupid to me. It has not once written code for me that was usable.

 

What I use it for instead is more like a dynamic language reference, e.g. "Can I pair multiple values to the same Dictionary key in JavaScript?" or "Why is [snippet] producing [error]?"

 

If I use it to help actually program, what I have to do is tell it what I want to do, e.g. "I want to scrape this .pdf for [data] and write it to a .txt file using [Language].  Explain an efficient way to do this without worrying any code.  Only provide a high-level explanation." The answer is usually not messed up in some way, but when I make additional clarification, I then ask "Now explain this at one lower level of abstraction".  Basically, I just want it to point me to the right library/class/function/whatever for the job.

 

Since I'm not a programmer and I don't know anything, even dum-dum languages like VBA with the Excel object model can be overwhelming.  There's great documentation for it, but even the most well-organized toolbox doesn't help you with finding the ones you need for the job.  Then there's always annoying syntax issues (e.g. you have to parenthesize arguments passed to a function, but must not for passing them to a method) that I will spend forever troubleshooting, and I haven't got time to deal with Stack Overflow (and don't trust half of the answers anyway).

 

The thing I don't understand is why, if you are a programmer and you do know what you're doing, why bother with this thing at all?  Is it not going to be faster to just write the code yourself than to take GPT's mess and clean it up?  Why bother with it until the model gets improved enough to actually write something functional?  Apparently, this model could pass the Google competence exam or whatever, and had already replaced copy writers and such.  What does that say about those workers that this is apparently an adequate substitute for what they do?

  • Like 1
Link to comment
Share on other sites

i use it quite often to write simple data transformation subroutines in python. some of them landed in a production code. the gain is i do not have to think about trivial things.

it is a tool. you can hurt yourself with a hammer that is normally quite useful for hanging pictures.

  • Like 2
Link to comment
Share on other sites

29 minutes ago, pirx said:

i use it quite often to write simple data transformation subroutines in python. some of them landed in a production code. the gain is i do not have to think about trivial things.

Computers are good at handling laborious, transformative, or repetitive tasks. I hardly ever write a program of any complexity that doesn't require some additional utility to do such things.

  

29 minutes ago, pirx said:

it is a tool. you can hurt yourself with a hammer that is normally quite useful for hanging pictures.

I haven't used it yet, personally (just having some good laughs at it's "Atari" BASIC code); but, maybe it's somewhat comparable to a hammer, at this stage (for whatever languages it actually knows how to work with). You don't use a hammer to do precision drilling. So, maybe the simpler the task, the more usable the results.

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...