Zendocon Posted February 11, 2021 Share Posted February 11, 2021 10 minutes ago, Intelligentleman said: Could there be a way to say: if input equals some weird combination of chars that couldn't possibly have been entered by a human... GOTO (line)? I'm rattling off from memory right now, but I think the only string commands are SET and PUT. SET sets the string value: example SET A$="BRITT". PUT displays the value: example PUT A$. Only useful if you're displaying a string more than once, to save characters. Maybe INPU A$ works to allow the user to input a value, but I would have to check. Quote Link to comment Share on other sites More sharing options...
Zendocon Posted February 11, 2021 Share Posted February 11, 2021 1 minute ago, Intelligentleman said: Shouldn't every alpha-based input have an equivalent numeric value? It should, but strings in ECS BASIC don't behave as character arrays like they do in C for example. I don't think you can fetch their ASCII values, so to speak. 1 Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 11, 2021 Author Share Posted February 11, 2021 Just now, Zendocon said: It should, but strings in ECS BASIC don't behave as character arrays like they do in C for example. I don't think you can fetch their ASCII values, so to speak. Ahh, ok. Yes, I was conflating ASCII with BASIC, lol. Quote Link to comment Share on other sites More sharing options...
Zendocon Posted February 11, 2021 Share Posted February 11, 2021 You might want to look at that link to my old website from the 90s for examples. There's a lot that you should be able to do but can't, and I tried hard to find various workarounds. The biggest problem you'll run into is space limitations. With only 2K on-board RAM, your programs are limited to 90-100 lines approximately. Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 11, 2021 Author Share Posted February 11, 2021 Ok. One last thought before I go to bed. The "<" and ">" signs. Does ESC BASIC assign any kind of a quantifiable "value" to an alphabetical user input? Could we say something like "IF [user input] < or > "BRITT" Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 11, 2021 Author Share Posted February 11, 2021 4 minutes ago, Zendocon said: You might want to look at that link to my old website from the 90s for examples. There's a lot that you should be able to do but can't, and I tried hard to find various workarounds. The biggest problem you'll run into is space limitations. With only 2K on-board RAM, your programs are limited to 90-100 lines approximately. Good to know, thank you. Is it possible for the ECS to run a program from tape/storage? Or does it always want to load the data into the RAM? Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 11, 2021 Author Share Posted February 11, 2021 11 minutes ago, Zendocon said: You might want to look at that link to my old website from the 90s for examples. There's a lot that you should be able to do but can't, and I tried hard to find various workarounds. The biggest problem you'll run into is space limitations. With only 2K on-board RAM, your programs are limited to 90-100 lines approximately. Can we make the ECS query a cassette drive to load in more information while discarding code that is no longer needed? Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 11, 2021 Share Posted February 11, 2021 What happens if you do this? 10 LET A=1 20 PRIN (A=1) 30 PRIN (A=0) It would display any numerical values assigned for the comparison. You could try A<2 and A>2 as well, though truth values would be the same for any type of comparison. I don't know about the strings, as posted above you might only be able to assign and print those, not process in any form. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 11, 2021 Share Posted February 11, 2021 6 hours ago, Zendocon said: It should, but strings in ECS BASIC don't behave as character arrays like they do in C for example. I don't think you can fetch their ASCII values, so to speak. The manual suggests that you can compare characters in a string like: IF A$(1)=B$(1) GOTO 10 So, perhaps that's the way to test a string ... 6 hours ago, Zendocon said: I'm rattling off from memory right now, but I think the only string commands are SET and PUT. SET sets the string value: example SET A$="BRITT". PUT displays the value: example PUT A$. Only useful if you're displaying a string more than once, to save characters. Maybe INPU A$ works to allow the user to input a value, but I would have to check. The manual says that INPU is only for numeric values, and that GET is for strings. So to prompt for a string: 10 PRIN "GIMME YER NAME!" 20 GET A$ Then again, I recall the manual being replete with errors and I do not have the errata sheet at hand. dZ. 2 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 11, 2021 Share Posted February 11, 2021 I managed to track down a copy of the "Step-By-Step Guide To Home Computing" that you could get for your ECS (my original is squirreled away in the closet). This guide offers a programming tutorial for ECS BASIC, and a detailed description of all commands and statements. It's been transcribed into a text file: http://www.spatula-city.mine.nu/~intvlib/inty/manuals/sbsgthc.txt dZ. 2 Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 11, 2021 Share Posted February 11, 2021 Yes. In the scanned book that DZ-Jay linked to, you have an advanced example program: 10 SET B$="Z" 20 SET A$="A" 30 PUT A$ 40 A$(1) = A$(1) + 1 50 IF (A$(1) > B$(1)) END 60 GOTO 30 It will increase the first element of A$ from "A" through "B", "C" etc until it becomes "2". However I don't know if it works with literal strings as since you can only use A$, B$, C$ you would have to assign one of those with the fixed value you want to test against, and then cycle the dynamic one against it, alternatively if you hard code your literal string to numeric variables (ASCII?) and use READ and DATA to compare values: 10 GET A$ 15 A=1 20 READ B 25 IF (B=-1) GOTO 50 30 IF (A$(A) = B) GOTO 40 35 GOTO 60 40 A=A+1 45 GOTO 20 50 PRIN "WELCOME" 55 END 60 PRIN "GO AWAY" 65 END 100 DATA 66,69,84,84,86,-1 Untested, and assuming strings are encoded as ASCII (otherwise change the data on line 100), it would test the first five letters in the input if those are BETTY. Once the required number of letters have been checked, if those matched you are welcome. As soon as the input string doesn't match the passcode, you are told to go away. I don't know what happens if the input string is shorter than required, or how you can check string length though. 1 Quote Link to comment Share on other sites More sharing options...
Zendocon Posted February 11, 2021 Share Posted February 11, 2021 8 hours ago, DZ-Jay said: The manual suggests that you can compare characters in a string like: IF A$(1)=B$(1) GOTO 10 So, perhaps that's the way to test a string ... The manual says that INPU is only for numeric values, and that GET is for strings. So to prompt for a string: 10 PRIN "GIMME YER NAME!" 20 GET A$ Then again, I recall the manual being replete with errors and I do not have the errata sheet at hand. dZ. Ah, GET. I knew there was a way for user input into a string. Yes, the printed manuals are full of errors. Even the document with a list of graphics from all the Mattel games had a lot of errors. In case you're wondering though, there are no other keywords for the Mr. BASIC games besides what's in the code examples. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 11, 2021 Share Posted February 11, 2021 1 minute ago, Zendocon said: Ah, GET. I knew there was a way for user input into a string. Yep. Honestly, re-reading that manual now brought back all the confusion I had when I was a kid trying to learn programming on the ECS, having been exposed to it earlier typing in short programs from Compute! magazine on my best friend's Commodore 64. There's quite a bit of stuff missing in ECS BASIC! Not having "ELSE," for instance, or only having three string variables, seem to be seriously onerous limitations. 1 minute ago, Zendocon said: Yes, the printed manuals are full of errors. I remember when we I got my ECS one Christmas and my father took the "errata" sheet that came with it and endeavor to fix the manual with his pen. At the end, that booklet had so much of it crossed out and notes on margin, that it probably would have been better to just re-type the entire thing! ? 1 minute ago, Zendocon said: Even the document with a list of graphics from all the Mattel games had a lot of errors. In case you're wondering though, there are no other keywords for the Mr. BASIC games besides what's in the code examples. Ah, thanks for that. I haven't played with Mr. BASIC since I got my copy a few years ago. I packed it for a move, and then forgot I had it. I should try it out one of these days, I've always been curious. :) Quote Link to comment Share on other sites More sharing options...
Zendocon Posted February 11, 2021 Share Posted February 11, 2021 2 minutes ago, DZ-Jay said: Ah, thanks for that. I haven't played with Mr. BASIC since I got my copy a few years ago. I packed it for a move, and then forgot I had it. I should try it out one of these days, I've always been curious. Yeah, I disassembled the ROM to find the keyword lists, since whoever created the manual decided the "definition by example" teaching method was good enough. There is a list of words in the ROM for each game, and everything I found in there existed somewhere within all the code snippets. The Mr. BASIC game is first in the ROM, then Vampire Bats, then Cannon. Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 11, 2021 Share Posted February 11, 2021 Missing ELSE doesn't seem as bad as (I presume) missing the colon in order to cram more statements in a single line, or (I presume again) missing the functionality to do anything else with IF statements than GOTO or END, i.e. no possibility to directly assign or print values. Every conditional needs to be inverted with spaghetti GOTO statements to avoid the desired condition to trigger. I can only imagine if you dig deep into ECS BASIC as an attempt to learn programming (much like how Sean's daughter was going to solve her programming class), you would end up with quite bad habits and very clumsy, ineffective programs. It probably is better than the Atari 2600 Compumate, but pretty much every "real" home computer has a better BASIC environment, not to mention faster. We did some bottom of the pack benchmarks before and IIRC even snails like CreatiVision and Comx-35 were done sooner than the ECS was. That itself is another argument that IntyBASIC may be misnamed as it turns out to be a good, compiled language while its counterpart the ECS BASIC barely is moving any data at all, both relating to the Intellivision. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 11, 2021 Share Posted February 11, 2021 (edited) 33 minutes ago, carlsson said: Missing ELSE doesn't seem as bad as (I presume) missing the colon in order to cram more statements in a single line, or (I presume again) missing the functionality to do anything else with IF statements than GOTO or END, i.e. no possibility to directly assign or print values. Every conditional needs to be inverted with spaghetti GOTO statements to avoid the desired condition to trigger. You can do any command on an IF statement, not just GOTO. The manual has examples such as: IF (A=0) PRIN "A is zero" IF (X>1) A = 0 To me, another insult added to the ECS BASIC injury is the missing difference operator (<>) and boolean operators. You can't even do "AND" or "OR"!!! Any expression that is not absolutely trivial requires you to get lost in a spaghetti maze of GOTOs. *sigh* Quote I can only imagine if you dig deep into ECS BASIC as an attempt to learn programming (much like how Sean's daughter was going to solve her programming class), you would end up with quite bad habits and very clumsy, ineffective programs. Indeed! Like I said, that's how I learned programming. When the next year my parents got me a Commodore 64 for Christmas, I had to re-learn it all over again! Not only that, I distinctly recall that it felt like wasted effort to learn ECS BASIC. It was such a disappointment. *double-sigh* Enough ranting. The ECS just brings back some rather painful childhood memories. -dZ. Edited February 11, 2021 by DZ-Jay 2 Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 12, 2021 Author Share Posted February 12, 2021 Getting closer to what I want to do. 1 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 12, 2021 Share Posted February 12, 2021 Looking good! Is that for your kids? Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 12, 2021 Share Posted February 12, 2021 By the way, if you want to compare a string name, you can do it, but one character at a time. Something like this: 10 SET A$ = "DZ-JAY" 15 A = 0 20 PRIN "WHAT IS YOUR NAME?" 30 GET B$ 40 FOR I=1 TO 6 50 IF A$(I)=B$(I) GOTO 60 55 A=A+1 60 NEXT I 70 IF A=0 GOTO 100 80 PRIN "HELLO DZ-JAY" 90 PRIN "NICE TO MEET YOU." 95 GOTO 110 100 PRIN "WHO ARE YOU?" 110 GOTO 20 That code is untested, but it shows how you can compare strings. 1 Quote Link to comment Share on other sites More sharing options...
Intelligentleman Posted February 12, 2021 Author Share Posted February 12, 2021 6 minutes ago, DZ-Jay said: By the way, if you want to compare a string name, you can do it, but one character at a time. Something like this: 10 SET A$ = "DZ-JAY" 15 A = 0 20 PRIN "WHAT IS YOUR NAME?" 30 GET B$ 40 FOR I=1 TO 6 50 IF A$(I)=B$(I) GOTO 60 55 A=A+1 60 NEXT I 70 IF A=0 GOTO 100 80 PRIN "HELLO DZ-JAY" 90 PRIN "NICE TO MEET YOU." 95 GOTO 110 100 PRIN "WHO ARE YOU?" 110 GOTO 20 That code is untested, but it shows how you can compare strings. Yes I think this is exactly what i was hoping to do. Thank you. I'd like to make a fun little game for my son to help him learn his numbers, letters, and other fundamental things. He's 6 and he loves all things mechanical, Electronics... So if I can make him feel like he's on a "mission" or something fun like that, he might learn better. I could layer in some game elements over time. Sound effects for wrong answers. Or what would be really fun is if I could animate the running man and then ask the user questions. Correct answers trigger a chime or maybe turns the running man a different color. Incorrect answers slow him down until he falls like in night stalker. Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 12, 2021 Share Posted February 12, 2021 Too bad that you need to give up 1/3 of the total string capacity in order to compare input. The (also untested) program I posted before tried a slightly different approach, but in the long run I suppose it doesn't matter. Perhaps if you're making a text adventure, hard coding strings every here and there would make it very messy, but I suppose ECS BASIC doesn't have functionality to RESTORE to a particular line number, meaning that even storing strings as numeric values would be hopeless in the long run. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 12, 2021 Share Posted February 12, 2021 1 hour ago, carlsson said: Too bad that you need to give up 1/3 of the total string capacity in order to compare input. Yes, but you can reuse he same variables for different strings. It still all have to be declarative instead of data driven, unfortunately. 1 hour ago, carlsson said: The (also untested) program I posted before tried a slightly different approach, but in the long run I suppose it doesn't matter. Sorry, I missed that one. 1 hour ago, carlsson said: Perhaps if you're making a text adventure, hard coding strings every here and there would make it very messy, but I suppose ECS BASIC doesn't have functionality to RESTORE to a particular line number, meaning that even storing strings as numeric values would be hopeless in the long run. Alas, no. There is no RESTORE at all. READ just cycles through the set of DATA statements in order. As opposed to IntyBASIC, which mixes data and code inline, I believe ECS BASIC puts data values in a special array in memory. I looked in the past through the source code of MS BASIC (from which this one was supposedly based originally), and I seem to recall that behavior. The ECS has a really crappy flavor of BASIC. But don't get me started again ... ? 1 Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 12, 2021 Share Posted February 12, 2021 (edited) ECS BASIC: IntyBASIC: Edited February 12, 2021 by carlsson 2 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 12, 2021 Share Posted February 12, 2021 ECS BASIC engine: IntyBASIC engine: 3 Quote Link to comment Share on other sites More sharing options...
carlsson Posted February 12, 2021 Share Posted February 12, 2021 (edited) 14 hours ago, carlsson said: We did some bottom of the pack benchmarks before Oh yes, here is the link where intvnut and I ran a very simple benchmark on different BASIC interpreters. The summary is that ECS BASIC runs at 1/5 of the speed of the slowest 8-bit BASIC computer ever made (or at least known to us, there may be some oddball model that is even slower). https://atariage.com/forums/topic/284474-ecs-basic-color-coding-patent/?do=findComment&comment=4145747 For some reason, I doubt Mattel would have included that in their marketing. Edited February 12, 2021 by carlsson 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.