The fundamental problem is that you didn't ever really enter the program. To enter a line, you start off with the line number, 3 for example, then the instructions and then press enter or return key. You can see the line(s) you've entered by typing 'list' followed by enter/return. Once you have entered all the lines, you can type 'run' followed by enter/return.
The program would immediately crash as GOTO 270 sends it to a line number that is not shown in the printout. If those lines were added to an existing program then there's really no telling what the program actually does, since we don't have the rest of the program.
@@FirstLast-gw5mg We may not know exactly what the program does, but there is some stuff we can infer and it seems to be score logic for a game, or how it handles certain text. I know that Peek/Poke are for addressing IO of some sort, and others have said that address is for a keyboard, so.... Get keyboard input and do the logic at line 270. Game does whatever it needs to there, which at some point references back to this. Doing something calls line 30 which sets X to itself +3, it moves something 3 units or increments a score. If X is greater than 38, call line 100 which is a game over "final score" text with some other logic I don't understand but probably calculates score from other sections of the code, given the context. Something else can call line 20 which sets I to itself + a pseudo random number with a seed of 3, does something I'm not sure of, but if I is less than 4, it makes it 4, and if it's greater than 36, it makes it 36. Perhaps this is the number of bullets dropped by an enemy on death. so on an so forth, I got bored. But yea, it's a little pew pew game. Probably someone's Asteroids clone.
_"Just like the cassette tapes, but in disk form."_ I get the feeling that there was some other, more popular device, that used that sort of format, too, magnetic, but spinning platters rather than tape. Escapes me what it was, though. :-) The code is an Apple II game, or fragment thereof. A rather old one: it appears to be Integer BASIC, not Applesoft. • 5: X is the column number in low-res graphics: 0-39. I is a random number from 4 to 40, but divisible by 4 (4, 8, 12, etc.). A is the ammo count. • 10: PEEK (-16384)-176 reads location $C000, the last key pressed, and subtracts 176 from it. That subtracts 128 to remove the strobe bit if set, and 48 to bring any key in the '1'..'9' range down to a binary value of 1..9. POKE -16368,0 clears the keyboard strobe, to allow a new keystroke to be received. • 20: A clear indication that part of this program listing is missing. But maybe not necessary, if you remove this line. • 30: Moves the current drawing location right 3 columns on the screen, ending the game if the drawing location hits the right edge of the screen. • 40: Adds a number chosen from (4, 4, 4, 8), i.e. one in four chance of adding 8 instead of 4, to I, making sure it doesn't exceed 36 (very near bottom row of screen). Clears the lo-res graphics screen and draws a 3-pixel vertical line at X, from just before to just after that line I. • 50: If the user did not press a key from '1'..'9', we continue drawing in the next column. • 60: Increment ammo count and draw a beam across the screen at a row corresponding to the '1'..'9' key pressed. And the rest of this is fairly obvious, I think, once you understand the above. This will probably work if you take out line 20 so it's not jumping off to the nonexistent line 270, but do keep in mind you'll need to be using Integer BASIC when you type it in. Both Apples you have have Applesoft BASIC in ROM (identified by the ']' prompt); you'll need to load Integer BASIC (identified by a '>') prompt from disk. Dealing with that is a bit more than I want to go into in a TH-cam comment. It also probably could be converted to Applesoft BASIC; probably just the RND() calls need to be fixed. But that, too, is a bit more than I can get into in a TH-cam comment.
BASIC was the language that many of us Gen-X computer nerds first learned, before going on to learn stuff like 6502 machine language et al. A few years after I learned BASIC, I went off to college and took a "intro to computer science" course taught by Thomas Kurtz who turned out to be one of the dudes who invented the language.
That was hilarious, Mitch. Don't worry... your experience reflected a lot of our first experiences. If it didn't get easier, we'd still be using an abacus. 😅👍
Oh, that's one of those *modern* computer programs where you type things in for yourself rather than writing them on paper forms, getting each line typed on to a punch card by a data prep operator, then getting the printout showing the typos back three days later! You lucky bastard!!! :)
It's honestly a bit odd to me to see someone who has no experience of these things and how much someone like myself takes for granted. Not knowing you type a line in with the line number and press ENTER at the end of each line is something that would never occur to me as unknown by others. It shows how much these things completely consumer us back in the day.
It's missing an important chunk that would have been at line 270. Besides that, there's a syntax error in the original code.. I think there's an underscore where there should be an equal sign on variable K
Ah this reminds me of typing machine code from magazine listings on my BBC B+ .... Debugging then realising there is an error on the magazine listings 😂😂
Those were the days - though they were bastardly, they were decent education tools as they taught me how to troubleshoot and code properly. Sifting through untested listings and printing errors was time consuming but I'd often end up changing their programs to improve them anyway.
Line 3 sets variables; Line 10 then reads a memory location, stores it in variable K and then puts a new value of '0' into memory location 16368; Line 20 then says goto line 270 - Which does not exist in the program. So it would never get past line 20. Sorry.
-16368 (not 16368) is not actually a memory location; it's a location in the CPU's _address space,_ yes, but it accesses the keyboard hardware. (There's more on this and the rest of the program in my other comment here.)
I learned Basic in 1980 on an Apple 2, at an amazing store called "Computers To Go" on Guadalupe street in Austin Texas. You rented time on one of their Apples for, I believe, $1 per 10 minutes. I'd be happy to give you my line-by-line interpretation of what I remember from those days. I expect you've already gotten better from others, but let me know if you want to hear my babble. Peek gets the number stored in the specified memory address, and poke puts that number into the other specified memory address. There's clearly more to the program because of the line 270 reference. It looks like the bulk of the game would be in the missing line 270 and beyond. Love what you guys do. I'll definitely visit if I ever get to England.
Honestly, the thing that sparks my mind the most is how an Apple II BASIC listing ended up on what, like you said, pretty clearly looks like a teleprinter/teletype. I want to believe there was some crazy kid in the 80s who had access to an Apple II with a serial card AND a teletype AND a serial-to-current-loop adapter and had the Apple II console output redirected to the teletype. This would be super dumb and pointless to do, but you could definitely do it. And there's nothing that I love more than doing dumb shit with fancy equipment.
I actually learned quite a lot watching this, despite being a software programmer (C, mostly) who started in QBasic, Some of the first computers I worked on, as a middleschool IT-wannabe, were Apple IIe's, but I had no idea they had BASIC on them, I thought they had to be booted from a floppy. So, why is this weird to me? Because QBasic was a text-editor that could modify the BASIC code like any text editor does, save it, load it, etc. So, then, how on earth does one do BASIC without a text-editor?! I was right there with you, banging my head wondering. Heh!
This is a BASIC program, but there were several versions about in the 1980s. The poke and peek commands are examining and writing to memory locations respectively, plot and vlin are both graphics commands. Most of this is standard BASIC and will work on any system that uses it regardless of the system or CPU (6502 or Z80). The key will be finding the system for those specific peek and poke commands (some used thise for characters, sone for other stuff). It isn't BBC, Apple at least I don't remember Apple using vlin as a command), Spectrum or Microsoft BASIC (as licensed), could be Atari, Commodore (but I don't think so) or Amiga.
First of all... END is a syntax error because you omitted the line number. It was supposed to be 130 END. Ordinarily if you enter a line with no line number, it is executed immediately, but END can't be executed immediately, only inside a program. If a line is entered with a line number, it is stored in memory. You can't go up to edit, you have to enter LIST to view the program in memory, and then it prints the lines out in numeric order. To correct a mistake after typing a line, simply type it again with the same line number. It will overwrite the previously entered line. Lines do not have to be entered in order, they'll just be stored in numeric order regardless of how they're entered. If you make a mistake entering line 3, you don't have to reenter the entire program just to reenter line 3. Once an entire program is stored in memory, entering RUN or GOTO # will begin executing the program. However the program as shown in that printout is definitely incomplete. 30 GOTO 270 tells it to jump to line 270... and there's no line 270 shown in the program. So it's just going to crash right away.
Brings back memories. I learned programming on a Dragon32 machine. It could take weeks to write and debug code and the result was usually very underwhelming
It's not complete. The use of END on line 130, indicates that there are more lines after that. Otherwise there's no point in using END, since the program would end anyway. That goes along with the call to line 270 on line 20. There's no way to guess what the rest could have been.
Like a few others in these comments, I started out with an Atari 8-bit computer. My magazine of choice (which I think was "Atari User") started adding a two-character checksum to each line of their program listing to help mitigate typos. Basically, you'd start by typing in (or loading from tape, if you'd done it before) a small program from the start of the magazine that, when run, would add a feature to BASIC that, every time you entered a line of code and hit enter, it showed the checksum of that line. If the two characters didn't match what was written in the magazine next to that line, you knew you'd made a mistake and would just retype that line. It was a godsend.
Half of it is missing! Line 20 Goto 270, basically says "Got to the line numbers 270 and continue running there". That's not included in this printout. So yes a "Fighting" game, but more is harder to answer.
If that had been the entire program for a game, I guarantee you would have been extremely disappointed with the result. A program that short would not have done anything interesting. BTW, my son and I visited the museum back in the summer. It's a fascinating place and it's so cool that you can play with so many of the exhibits - some of which were built by LMNC himself.
Technology progressed annoyingly fast when I was a Gen Xer at school, I was being taught Basic in 1992-93 then by about 1994 we had windows 3.1, then by 1995 we had windows 95 and basic had become obsolete... I wondered what the heck was coming next, left my head spinning!
Don’t know about Apple. Learned to program on Atari. I can tell it is spaghetti code already though. That goto command is a dead giveaway. I remember the magazine code though. I was working a contract in Saudi Arabia. Several of us had computers. Atari 400, Commodore Vic-20 and Apple II were common brands. When the new copy of Byte magazine came out we would immediately search for the program to be typed in. One of us would read the characters one at a time while someone else typed it in. Every five lines, we went back and one of us would read the characters off the screen while the other verified it matched the magazine. Some programs covered several pages. The feeling you got when the program worked was magic. When we went to the computer stores in Dhahran or Al Khobar, we could get discounts on new software by trading the programs as demo software.
1:17 The only thing I can tell you, is that's BASIC, and peek/poke are for addressing bits of memory/IO. Someone recently released a video with their own 6502(numbers may be wrong) CPU running basic, and used peek/poke to get the screen to display text in a rudimentary way, and by screen I mean a little 16 character display you'd find on like an MP3 player from y2k.
PEEK and POKE aren't commands or words for a game specifically, those are used w/BASIC to do stuff with the memory on the system. Also in BASIC you can list out the program again as well edit specific lines if required, no need to retype the whole thing.
I was an Atari guy BITD. I had a subscription to a computer magazine which had a new game program every month; I'd spend hours keying it all in. It never worked right the first time, and you usually had to wait a month for the next issue for all the corrections to the code! I never went into programming because it was so frustrating.
writing BASIC code when it really did something, and it was rigid, goto 100, there were people who went into Tandy and wrote for next poke loops and hung around until the screen filled with memory mapped video then overote the program. 10 for x = 0 to 65534 20 poke(x,65) 30 next
The apple 2 has some basic line editing functionality where you can call up a line again and fix errors, but it's pretty primitive and janky. Commodore's line editor is a lot better. All of this is incredibly primitive though.
Yeah, you don't have to get everything 100% correct... there are means to edit what you've typed in.... sadly, completely different means on each family of machines though... and the Apple ][ was probably THE least popular machine in the UK.... during a life of geekery that began in 1979, I only ever saw ONE Apple ][.
This is as far as I got. The fact that it has a modulo keyword indicates to me that it does not run on an apple 2. This is a very small part of a much larger program. 10 REM Initialize variables 20 X = 0: I = RND(9) * 4 + 4: H = 0: A = 0: S = 0: K = 0 30 REM Player movement and shooting 40 X = X + 3: IF X > 38 THEN GOTO 100 50 I = I + RND(3) * 4 - 4: IF I < 4 THEN I = 4: IF I > 36 THEN I = 36 60 GR: COLOR = 9: VLIN I - 1, I + 1 AT X: PLOT X + 1, I 70 K = PEEK(-16384) - 176: POKE -16368,0 80 IF K < 1 OR K > 9 THEN GOTO 30 90 A = A + 1: IF A > 30 THEN GOTO 100 100 COLOR = 3 + (A - INT(A / 2) * 2): HLIN 0, 39 AT K * 4 110 IF K * 4 = I THEN PRINT "BLEEPER DESTROYED.": PRINT: S = S + 1: PRINT "SCORE SO FAR:"; S: PRINT: X = 0 120 GOTO 30 130 REM Game over 140 TEXT: CALL -936: PRINT "FINAL SCORE: "; S 150 PRINT "AMMUNITION EXPENDED:"; A: PRINT 160 A = 0: INPUT "TYPE 0 TO PLAY AGAIN"; S: IF S = 0 THEN GOTO 20 170 END 270 REM Initialize game 290 X = 10: I = RND(9) * 4 + 4 300 A = 30: S = 0 310 GOTO 30
The character casing of the "SYNTAX ERROR" is also different between the Apple II used and the printout, indicating that it might have been written for a different BASIC interpreter. The PEEK command is likely reading a keyboard or joystick input register given how the code uses it, so that might allow to verify a possible target sytstem.
@@0ufo0 It is an Apple II (no other system matches the PEEK and POKE being used there), but it's not Applesoft BASIC, it's Integer BASIC. Good point about the "Syntax Error" case; also the "Ready:" prompt is not something that either Apple II BASIC gave (Applesoft uses "]" and Integer BASIC uses ">"). I wonder if it wasn't typed in on some other system that used a printing terminal by someone who didn't realise it was a program specific to Apple II. The comment I entered about four hours before the one you're replying to gives a detailed explanation of most of what's going on there.
Had Chat gpt update it fill it in correct it and make it more playable To make this more playable, I'll address some game mechanics and refine the code for smoother operation. Here are the main goals: 1. **Player Control**: Allow the player to control `K` with inputs. 2. **Enemy Movement and Collision**: Introduce clearer mechanics for when "bleepers" are destroyed. 3. **Score Tracking and Restart**: Display score consistently and make replay intuitive. This version will use simple keyboard input for player movement (`A` to move left, `D` to move right). It will add the concept of a moving target or enemy (`I`) that the player aims to destroy by aligning with it. Here's an updated and playable version of the game: ```basic 10 GR: POKE -16368, 0 20 X = 0: S = 0: A = 0: I = INT(RND(1) * 30) + 4: K = 20 30 HLIN 0, 39 AT I: REM DRAW ENEMY LINE 40 COLOR = 3: PLOT K, 19: REM PLOT PLAYER AT K 50 GET A$: IF A$ = "A" AND K > 0 THEN K = K - 1 60 IF A$ = "D" AND K < 39 THEN K = K + 1 70 IF A$ = " " THEN GOTO 100: REM SHOOT 80 GOTO 30: REM CONTINUE GAME LOOP 100 HLIN K, K AT 18: REM SHOOTING ACTION 110 IF K = I THEN GOSUB 200 120 HLIN 0, 39 AT I: I = INT(RND(1) * 30) + 4: REM MOVE ENEMY 130 GOTO 30 200 PRINT "BLEEPER DESTROYED!": S = S + 1 210 PRINT "SCORE: "; S 220 RETURN 300 TEXT: CALL -936: PRINT "FINAL SCORE: "; S 310 INPUT "TYPE 0 TO PLAY AGAIN: "; R: IF R = 0 THEN GOTO 10 320 END ``` ### Explanation of Key Additions 1. **Main Game Loop** (lines 30-80): - `HLIN` draws the enemy line (`I`) at a random position. - `PLOT` plots the player character (`K`) at a position the player controls. - `GET A$` checks for keypresses to move the player (`A` to move left, `D` to move right). 2. **Player Actions**: - **Move Left (`A`)**: Decreases `K` to move the player left, with a boundary check. - **Move Right (`D`)**: Increases `K` to move the player right. - **Shoot (`Space`)**: Checks if the player shot aligns with the enemy position (`K = I`). 3. **Enemy Movement**: - After each turn, the enemy position (`I`) is randomized to keep the game challenging. 4. **Score and Replay**: - `S` tracks the score, and it increments each time the player aligns with and "destroys" the enemy. - After a "bleeper" is destroyed, the score is updated, and a prompt for replay appears if the player wishes to restart.
"Playable?" Have you actually tried to play this? It's a classic total failure of ChatGPT. It's amazing how much stuff it can get wrong: • It's flipped the orientation of the game by 90 degrees. • It's invented a moving player (the original player does not move). • You can't tell where the player is after a bit of movement because when it plots the new player player position, it never erases the mark for the previous player position. • The enemy has become a single line all the way across the screen, which is not exactly hard to hit. (But that's good, because you can't tell where your player is.) Sometimes it's above, sometimes below the player. • Despite the "Final score" bit of code at the end, it never actually executes it, so the game never ends and that code is pointless. • And as a bonus it's quietly changed the language from Apple Integer BASIC to Applesoft. There are probably more issues, but I can't be bothered to spend more than two minutes pointing out the most obvious problems here.
@@AMPProf Well, it's very, _very_ broken. This is why the output of LLMs needs to be checked quite carefully by someone who knows what they're doing when you have them produce computer code.
The fundamental problem is that you didn't ever really enter the program. To enter a line, you start off with the line number, 3 for example, then the instructions and then press enter or return key. You can see the line(s) you've entered by typing 'list' followed by enter/return. Once you have entered all the lines, you can type 'run' followed by enter/return.
The program would immediately crash as GOTO 270 sends it to a line number that is not shown in the printout. If those lines were added to an existing program then there's really no telling what the program actually does, since we don't have the rest of the program.
@@FirstLast-gw5mg We may not know exactly what the program does, but there is some stuff we can infer and it seems to be score logic for a game, or how it handles certain text. I know that Peek/Poke are for addressing IO of some sort, and others have said that address is for a keyboard, so....
Get keyboard input and do the logic at line 270. Game does whatever it needs to there, which at some point references back to this.
Doing something calls line 30 which sets X to itself +3, it moves something 3 units or increments a score.
If X is greater than 38, call line 100 which is a game over "final score" text with some other logic I don't understand but probably calculates score from other sections of the code, given the context.
Something else can call line 20 which sets I to itself + a pseudo random number with a seed of 3, does something I'm not sure of, but if I is less than 4, it makes it 4, and if it's greater than 36, it makes it 36. Perhaps this is the number of bullets dropped by an enemy on death.
so on an so forth, I got bored.
But yea, it's a little pew pew game. Probably someone's Asteroids clone.
_"Just like the cassette tapes, but in disk form."_
I get the feeling that there was some other, more popular device, that used that sort of format, too, magnetic, but spinning platters rather than tape. Escapes me what it was, though. :-)
The code is an Apple II game, or fragment thereof. A rather old one: it appears to be Integer BASIC, not Applesoft.
• 5: X is the column number in low-res graphics: 0-39. I is a random number from 4 to 40, but divisible by 4 (4, 8, 12, etc.). A is the ammo count.
• 10: PEEK (-16384)-176 reads location $C000, the last key pressed, and subtracts 176 from it. That subtracts 128 to remove the strobe bit if set, and 48 to bring any key in the '1'..'9' range down to a binary value of 1..9. POKE -16368,0 clears the keyboard strobe, to allow a new keystroke to be received.
• 20: A clear indication that part of this program listing is missing. But maybe not necessary, if you remove this line.
• 30: Moves the current drawing location right 3 columns on the screen, ending the game if the drawing location hits the right edge of the screen.
• 40: Adds a number chosen from (4, 4, 4, 8), i.e. one in four chance of adding 8 instead of 4, to I, making sure it doesn't exceed 36 (very near bottom row of screen). Clears the lo-res graphics screen and draws a 3-pixel vertical line at X, from just before to just after that line I.
• 50: If the user did not press a key from '1'..'9', we continue drawing in the next column.
• 60: Increment ammo count and draw a beam across the screen at a row corresponding to the '1'..'9' key pressed.
And the rest of this is fairly obvious, I think, once you understand the above.
This will probably work if you take out line 20 so it's not jumping off to the nonexistent line 270, but do keep in mind you'll need to be using Integer BASIC when you type it in. Both Apples you have have Applesoft BASIC in ROM (identified by the ']' prompt); you'll need to load Integer BASIC (identified by a '>') prompt from disk. Dealing with that is a bit more than I want to go into in a TH-cam comment.
It also probably could be converted to Applesoft BASIC; probably just the RND() calls need to be fixed. But that, too, is a bit more than I can get into in a TH-cam comment.
This should be the top comment.
BASIC was the language that many of us Gen-X computer nerds first learned, before going on to learn stuff like 6502 machine language et al. A few years after I learned BASIC, I went off to college and took a "intro to computer science" course taught by Thomas Kurtz who turned out to be one of the dudes who invented the language.
I'm 61 years old. I grew up with these bastard machine's
That was hilarious, Mitch. Don't worry... your experience reflected a lot of our first experiences. If it didn't get easier, we'd still be using an abacus. 😅👍
Surprised you didn't pop next dooor to the computer museum
Oh, that's one of those *modern* computer programs where you type things in for yourself rather than writing them on paper forms, getting each line typed on to a punch card by a data prep operator, then getting the printout showing the typos back three days later! You lucky bastard!!! :)
It's honestly a bit odd to me to see someone who has no experience of these things and how much someone like myself takes for granted.
Not knowing you type a line in with the line number and press ENTER at the end of each line is something that would never occur to me as unknown by others. It shows how much these things completely consumer us back in the day.
It's missing an important chunk that would have been at line 270. Besides that, there's a syntax error in the original code.. I think there's an underscore where there should be an equal sign on variable K
Ah this reminds me of typing machine code from magazine listings on my BBC B+ .... Debugging then realising there is an error on the magazine listings 😂😂
Those were the days - though they were bastardly, they were decent education tools as they taught me how to troubleshoot and code properly. Sifting through untested listings and printing errors was time consuming but I'd often end up changing their programs to improve them anyway.
Line 3 sets variables; Line 10 then reads a memory location, stores it in variable K and then puts a new value of '0' into memory location 16368; Line 20 then says goto line 270 - Which does not exist in the program. So it would never get past line 20. Sorry.
-16368 (not 16368) is not actually a memory location; it's a location in the CPU's _address space,_ yes, but it accesses the keyboard hardware. (There's more on this and the rest of the program in my other comment here.)
“Shall we play a game?”
lol
Y E S "return"
All I used to do as a kid was type BASIC programmes from magazines and books into my BBC B I loved it.
I learned Basic in 1980 on an Apple 2, at an amazing store called "Computers To Go" on Guadalupe street in Austin Texas. You rented time on one of their Apples for, I believe, $1 per 10 minutes. I'd be happy to give you my line-by-line interpretation of what I remember from those days. I expect you've already gotten better from others, but let me know if you want to hear my babble. Peek gets the number stored in the specified memory address, and poke puts that number into the other specified memory address. There's clearly more to the program because of the line 270 reference. It looks like the bulk of the game would be in the missing line 270 and beyond.
Love what you guys do. I'll definitely visit if I ever get to England.
Honestly, the thing that sparks my mind the most is how an Apple II BASIC listing ended up on what, like you said, pretty clearly looks like a teleprinter/teletype.
I want to believe there was some crazy kid in the 80s who had access to an Apple II with a serial card AND a teletype AND a serial-to-current-loop adapter and had the Apple II console output redirected to the teletype. This would be super dumb and pointless to do, but you could definitely do it. And there's nothing that I love more than doing dumb shit with fancy equipment.
So a teletype astroids game
Must be!
I actually learned quite a lot watching this, despite being a software programmer (C, mostly) who started in QBasic, Some of the first computers I worked on, as a middleschool IT-wannabe, were Apple IIe's, but I had no idea they had BASIC on them, I thought they had to be booted from a floppy.
So, why is this weird to me? Because QBasic was a text-editor that could modify the BASIC code like any text editor does, save it, load it, etc. So, then, how on earth does one do BASIC without a text-editor?!
I was right there with you, banging my head wondering. Heh!
This is a BASIC program, but there were several versions about in the 1980s. The poke and peek commands are examining and writing to memory locations respectively, plot and vlin are both graphics commands. Most of this is standard BASIC and will work on any system that uses it regardless of the system or CPU (6502 or Z80). The key will be finding the system for those specific peek and poke commands (some used thise for characters, sone for other stuff).
It isn't BBC, Apple at least I don't remember Apple using vlin as a command), Spectrum or Microsoft BASIC (as licensed), could be Atari, Commodore (but I don't think so) or Amiga.
First of all... END is a syntax error because you omitted the line number. It was supposed to be 130 END. Ordinarily if you enter a line with no line number, it is executed immediately, but END can't be executed immediately, only inside a program.
If a line is entered with a line number, it is stored in memory. You can't go up to edit, you have to enter LIST to view the program in memory, and then it prints the lines out in numeric order. To correct a mistake after typing a line, simply type it again with the same line number. It will overwrite the previously entered line. Lines do not have to be entered in order, they'll just be stored in numeric order regardless of how they're entered. If you make a mistake entering line 3, you don't have to reenter the entire program just to reenter line 3.
Once an entire program is stored in memory, entering RUN or GOTO # will begin executing the program. However the program as shown in that printout is definitely incomplete. 30 GOTO 270 tells it to jump to line 270... and there's no line 270 shown in the program. So it's just going to crash right away.
Brings back memories. I learned programming on a Dragon32 machine. It could take weeks to write and debug code and the result was usually very underwhelming
It's not complete. The use of END on line 130, indicates that there are more lines after that. Otherwise there's no point in using END, since the program would end anyway. That goes along with the call to line 270 on line 20. There's no way to guess what the rest could have been.
Like a few others in these comments, I started out with an Atari 8-bit computer. My magazine of choice (which I think was "Atari User") started adding a two-character checksum to each line of their program listing to help mitigate typos. Basically, you'd start by typing in (or loading from tape, if you'd done it before) a small program from the start of the magazine that, when run, would add a feature to BASIC that, every time you entered a line of code and hit enter, it showed the checksum of that line. If the two characters didn't match what was written in the magazine next to that line, you knew you'd made a mistake and would just retype that line. It was a godsend.
Half of it is missing! Line 20 Goto 270, basically says "Got to the line numbers 270 and continue running there". That's not included in this printout. So yes a "Fighting" game, but more is harder to answer.
I loved Programming back in the 80/90s mad some great programs, or changing things in existing programs.
If that had been the entire program for a game, I guarantee you would have been extremely disappointed with the result. A program that short would not have done anything interesting.
BTW, my son and I visited the museum back in the summer. It's a fascinating place and it's so cool that you can play with so many of the exhibits - some of which were built by LMNC himself.
Technology progressed annoyingly fast when I was a Gen Xer at school, I was being taught Basic in 1992-93 then by about 1994 we had windows 3.1, then by 1995 we had windows 95 and basic had become obsolete... I wondered what the heck was coming next, left my head spinning!
Don’t know about Apple. Learned to program on Atari.
I can tell it is spaghetti code already though. That goto command is a dead giveaway.
I remember the magazine code though. I was working a contract in Saudi Arabia. Several of us had computers. Atari 400, Commodore Vic-20 and Apple II were common brands.
When the new copy of Byte magazine came out we would immediately search for the program to be typed in.
One of us would read the characters one at a time while someone else typed it in. Every five lines, we went back and one of us would read the characters off the screen while the other verified it matched the magazine.
Some programs covered several pages. The feeling you got when the program worked was magic.
When we went to the computer stores in Dhahran or Al Khobar, we could get discounts on new software by trading the programs as demo software.
BASIC was so unstructured that you couldn't help but write spaghetti code. Good times.
I think it's a first draft of the code that made the pagers explode, seeing; Print "Bleepers explode".
If it's any consolation, there were errors like these in programs listed in magazines anyway, even in 1k games for the ZX81.
i was curious if you have tried scanning it and searching the text to see if there is any chance that the rest could be on the internet somewhere?
Really feel like you guys need to do some crossovers with curiosmarc
We had an Apple IIe when I was a young kid - the floppy drives were a must for saving and copying
1:17 The only thing I can tell you, is that's BASIC, and peek/poke are for addressing bits of memory/IO. Someone recently released a video with their own 6502(numbers may be wrong) CPU running basic, and used peek/poke to get the screen to display text in a rudimentary way, and by screen I mean a little 16 character display you'd find on like an MP3 player from y2k.
PEEK and POKE aren't commands or words for a game specifically, those are used w/BASIC to do stuff with the memory on the system. Also in BASIC you can list out the program again as well edit specific lines if required, no need to retype the whole thing.
"I can do more than burn myself with a soldering iron. I can burn myself in places I've never burned myself before!"
I was an Atari guy BITD. I had a subscription to a computer magazine which had a new game program every month; I'd spend hours keying it all in. It never worked right the first time, and you usually had to wait a month for the next issue for all the corrections to the code! I never went into programming because it was so frustrating.
writing BASIC code when it really did something, and it was rigid, goto 100, there were people who went into Tandy and wrote for next poke loops and hung around until the screen filled with memory mapped video then overote the program.
10 for x = 0 to 65534
20 poke(x,65)
30 next
What a brilliant video!
Computers? I can't see them things taking off.
Nice video ! Would love to visit someday 🙂
Yes, there was a copy and past feature. It was called a cassette tape.
You need a diskett station to the computer tosave the program. Regards Stig Österberg from Dalsbruk in Finland
02:13 I had a creed 7B, hooked up to my ham radio station, late 1970s or early 1980s. Fun, but a bit noisy.
And I thought typing in BASIC programs was basic knowledge...
I want to see when Sam looks your video 😂 like ai trying to learn to walk
You need to type in 4, 8, 15, 16, 23 and 42 every 108 minutes
(I dunno - was LOST even on in the UK?)
Used an Apple ][ in school course, was a fun system (compared to CBM Basic)
The apple 2 has some basic line editing functionality where you can call up a line again and fix errors, but it's pretty primitive and janky. Commodore's line editor is a lot better. All of this is incredibly primitive though.
good luck if you ever use any punch card systems...
Its missing lines, looks like basic.
Yeah, you way over thought that code. It doesn't get any simpler than basic
Thank you for your engagement 😂
Maybe read first some documentation before wildly jumping into the wood that is called a vintage computer.
Wheres the fun in that! Interesting to view it from the perspective of a kid at the time with no internet for reference!
you cant use old computers without the manual or some tutorial.
2:56 Adrian McEwen has restored one of those teleprinters over on his channel. th-cam.com/video/3YZY0edw8Co/w-d-xo.html
That LOOK MUM NO COMPUTER guy is a fraud. He has ALL the computers!! His whole channel is a lie, whoever he is.
who he?! What now?!
Yeah, you don't have to get everything 100% correct... there are means to edit what you've typed in.... sadly, completely different means on each family of machines though... and the Apple ][ was probably THE least popular machine in the UK.... during a life of geekery that began in 1979, I only ever saw ONE Apple ][.
You uh, you really wanted the world to see you struggle with apple II basic?
This is as far as I got.
The fact that it has a modulo keyword indicates to me that it does not run on an apple 2.
This is a very small part of a much larger program.
10 REM Initialize variables
20 X = 0: I = RND(9) * 4 + 4: H = 0: A = 0: S = 0: K = 0
30 REM Player movement and shooting
40 X = X + 3: IF X > 38 THEN GOTO 100
50 I = I + RND(3) * 4 - 4: IF I < 4 THEN I = 4: IF I > 36 THEN I = 36
60 GR: COLOR = 9: VLIN I - 1, I + 1 AT X: PLOT X + 1, I
70 K = PEEK(-16384) - 176: POKE -16368,0
80 IF K < 1 OR K > 9 THEN GOTO 30
90 A = A + 1: IF A > 30 THEN GOTO 100
100 COLOR = 3 + (A - INT(A / 2) * 2): HLIN 0, 39 AT K * 4
110 IF K * 4 = I THEN PRINT "BLEEPER DESTROYED.": PRINT: S = S + 1: PRINT "SCORE SO FAR:"; S: PRINT: X = 0
120 GOTO 30
130 REM Game over
140 TEXT: CALL -936: PRINT "FINAL SCORE: "; S
150 PRINT "AMMUNITION EXPENDED:"; A: PRINT
160 A = 0: INPUT "TYPE 0 TO PLAY AGAIN"; S: IF S = 0 THEN GOTO 20
170 END
270 REM Initialize game
290 X = 10: I = RND(9) * 4 + 4
300 A = 30: S = 0
310 GOTO 30
The character casing of the "SYNTAX ERROR" is also different between the Apple II used and the printout, indicating that it might have been written for a different BASIC interpreter. The PEEK command is likely reading a keyboard or joystick input register given how the code uses it, so that might allow to verify a possible target sytstem.
@@0ufo0 It is an Apple II (no other system matches the PEEK and POKE being used there), but it's not Applesoft BASIC, it's Integer BASIC. Good point about the "Syntax Error" case; also the "Ready:" prompt is not something that either Apple II BASIC gave (Applesoft uses "]" and Integer BASIC uses ">"). I wonder if it wasn't typed in on some other system that used a printing terminal by someone who didn't realise it was a program specific to Apple II.
The comment I entered about four hours before the one you're replying to gives a detailed explanation of most of what's going on there.
amazing very cool thanks for sharing!
Had Chat gpt update it fill it in correct it and make it more playable To make this more playable, I'll address some game mechanics and refine the code for smoother operation. Here are the main goals:
1. **Player Control**: Allow the player to control `K` with inputs.
2. **Enemy Movement and Collision**: Introduce clearer mechanics for when "bleepers" are destroyed.
3. **Score Tracking and Restart**: Display score consistently and make replay intuitive.
This version will use simple keyboard input for player movement (`A` to move left, `D` to move right). It will add the concept of a moving target or enemy (`I`) that the player aims to destroy by aligning with it.
Here's an updated and playable version of the game:
```basic
10 GR: POKE -16368, 0
20 X = 0: S = 0: A = 0: I = INT(RND(1) * 30) + 4: K = 20
30 HLIN 0, 39 AT I: REM DRAW ENEMY LINE
40 COLOR = 3: PLOT K, 19: REM PLOT PLAYER AT K
50 GET A$: IF A$ = "A" AND K > 0 THEN K = K - 1
60 IF A$ = "D" AND K < 39 THEN K = K + 1
70 IF A$ = " " THEN GOTO 100: REM SHOOT
80 GOTO 30: REM CONTINUE GAME LOOP
100 HLIN K, K AT 18: REM SHOOTING ACTION
110 IF K = I THEN GOSUB 200
120 HLIN 0, 39 AT I: I = INT(RND(1) * 30) + 4: REM MOVE ENEMY
130 GOTO 30
200 PRINT "BLEEPER DESTROYED!": S = S + 1
210 PRINT "SCORE: "; S
220 RETURN
300 TEXT: CALL -936: PRINT "FINAL SCORE: "; S
310 INPUT "TYPE 0 TO PLAY AGAIN: "; R: IF R = 0 THEN GOTO 10
320 END
```
### Explanation of Key Additions
1. **Main Game Loop** (lines 30-80):
- `HLIN` draws the enemy line (`I`) at a random position.
- `PLOT` plots the player character (`K`) at a position the player controls.
- `GET A$` checks for keypresses to move the player (`A` to move left, `D` to move right).
2. **Player Actions**:
- **Move Left (`A`)**: Decreases `K` to move the player left, with a boundary check.
- **Move Right (`D`)**: Increases `K` to move the player right.
- **Shoot (`Space`)**: Checks if the player shot aligns with the enemy position (`K = I`).
3. **Enemy Movement**:
- After each turn, the enemy position (`I`) is randomized to keep the game challenging.
4. **Score and Replay**:
- `S` tracks the score, and it increments each time the player aligns with and "destroys" the enemy.
- After a "bleeper" is destroyed, the score is updated, and a prompt for replay appears if the player wishes to restart.
"Playable?" Have you actually tried to play this?
It's a classic total failure of ChatGPT. It's amazing how much stuff it can get wrong:
• It's flipped the orientation of the game by 90 degrees.
• It's invented a moving player (the original player does not move).
• You can't tell where the player is after a bit of movement because when it plots the new player player position, it never erases the mark for the previous player position.
• The enemy has become a single line all the way across the screen, which is not exactly hard to hit. (But that's good, because you can't tell where your player is.) Sometimes it's above, sometimes below the player.
• Despite the "Final score" bit of code at the end, it never actually executes it, so the game never ends and that code is pointless.
• And as a bonus it's quietly changed the language from Apple Integer BASIC to Applesoft.
There are probably more issues, but I can't be bothered to spend more than two minutes pointing out the most obvious problems here.
awesome nice one!
@@Curt_Sampson did i post un run code? Yes
@@AMPProf Well, it's very, _very_ broken. This is why the output of LLMs needs to be checked quite carefully by someone who knows what they're doing when you have them produce computer code.