[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2024-02-13T18:10:00-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/forum/4 2024-02-13T18:10:00-05:00 2024-02-13T18:10:00-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39375#p39375 <![CDATA[General Discussion • Re: New BASIC website]]> I added a link to your site in mine as well.
Your BASIC in COBOL looks awesome.

Statistics: Posted by bongomeno — Tue Feb 13, 2024 6:10 pm


]]>
2024-02-05T15:41:40-05:00 2024-02-05T15:41:40-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39374#p39374 <![CDATA[General Discussion • Re: New BASIC website]]> I added your link to my site's link page. (Let me know if you want me to take it off for whatever reason)

Statistics: Posted by Erik — Mon Feb 05, 2024 3:41 pm


]]>
2024-02-05T15:09:06-05:00 2024-02-05T15:09:06-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39373#p39373 <![CDATA[General Discussion • Re: Small BASIC]]>
I can't say I'm a fan of the 'EndFor' syntax instead of the tried and true 'NEXT' though...

Statistics: Posted by Erik — Mon Feb 05, 2024 3:09 pm


]]>
2023-12-19T11:52:30-05:00 2023-12-19T11:52:30-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39370#p39370 <![CDATA[General Discussion • Re: Small BASIC]]> I do favor BASIC 256 as a learning/testing language.
My favorite is probably Just Basic due to the simple programming lesson it provides.

Statistics: Posted by bongomeno — Tue Dec 19, 2023 11:52 am


]]>
2023-12-16T15:39:31-05:00 2023-12-16T15:39:31-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39368#p39368 <![CDATA[General Discussion • Re: Small BASIC]]> https://sourceforge.net/projects/smallbasic/ -- I don't believe it to be related.) But this one seems very "new-Microsoft" in its approach and I don't understand what they're trying to do. Let me take off my Confused Grumpy Old Man outfit and put on my Negative Nancy dress (don't worry, there will be plenty of Confused Grumpy Old Man too...)

On the one hand it's meant to help people move from "brick programming" to "text programming" but it tries to explain the fundamentals of programming, which they should already know about since they went through the "brick" interface.
Something like Scratch shields the programmer from spooky instruction names and having to remember which argument goes where... usually a complete and well-structured doc can fix it... but they created an auto-completion system to make up for it instead.
They're targeting kids but the doc is written like boring business PowerPoint presentations (where they insert those weird mascots everywhere, which I'm sure is going to turn off beginners above the age of 16.)
Their idea of "simplicity" is to reduce what can be done with the language (fewer keywords and built-in instructions) while they're aware simplicity comes from the language's predictability (for instance, how variables initialize to 0 rather than just allocating memory like C does.) They know that because they chose BASIC as a starting point.

Many people started programming with BASIC or even Pascal when they were kids, and they managed. Some continued to program and moved to more complex languages, others lost interest and stopped programming altogether. Ten years ago, it was said that everything would become brick-based and it was a great way to teach kids (again, it wasn't a problem in the 80s.) Now that they taught people not to remember instructions and where arguments go, they're trying to go back to text? I don't get it. Maybe they figured out they can't really provide something 100% flexible in a 100% controlled environment.

I remember watching a video of someone making the case that Microsoft spent half its time following fads, and the other half was dedicated to reverting the changes they introduced after the lackluster response from customers. Not to say brick-type interface is their responsibility, the problem I have is:
Another word you might hear is algorithm. It sounds complicated, but you probably already know what it means.
Do they even know who their target audience is?

It's one thing to design a language for a specific purpose, it's another to design a language for the sake of learning that language. I don't get it.

Statistics: Posted by MikeHawk — Sat Dec 16, 2023 3:39 pm


]]>
2023-12-15T17:23:39-05:00 2023-12-15T17:23:39-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39367#p39367 <![CDATA[General Discussion • Re: New BASIC website]]>

Statistics: Posted by buddpaul — Fri Dec 15, 2023 5:23 pm


]]>
2023-12-15T17:22:24-05:00 2023-12-15T17:22:24-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39366#p39366 <![CDATA[General Discussion • Small BASIC]]> https://smallbasic-publicwebsite.azurewebsites.net/

Statistics: Posted by buddpaul — Fri Dec 15, 2023 5:22 pm


]]>
2023-10-05T21:25:15-05:00 2023-10-05T21:25:15-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39362#p39362 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>
To use SVG in Net Basic, first call the HTML command to break from the text output area.

Code:

5 PRINT "SVG sine wave"10 HTML20 PRINT "<svg width = '640' height = '480'>"30 FOR i = 1 TO 36040 PRINT "<rect x = '"; i / 360 * 320; "' y = '"; sin(i / 180 * 3.14) * 50 + 50; "' width = '1' height = '1' />"50 NEXT i60 PRINT "</svg>"
Program encoded URL: https://www.lucidapogee.com/netbasic/?l ... Fsvg%3E%22

Code:

1 REM https://rosettacode.org/wiki/Draw_a_sphere5 PRINT "SVG sphere"10 HTML20 PRINT "<svg width = '640' height = '480'>"30 LET j = 240 FOR i = 221 TO 0 STEP j * -150 FOR k = -3.14 TO 3.14 STEP .0260 PRINT "<rect x = '"; 221 + i * sin(k); "' y = '"; 222 + 221 * cos(k); "' width = '1' height = '1' />"70 PRINT "<rect x = '"; 221 + 221 * sin(k); "' y = '"; 222 + (i - 1) * cos(k); "' width = '1' height = '1' />"80 NEXT k90 LET j = j + 1100 NEXT i
Program encoded URL: https://www.lucidapogee.com/netbasic/?l ... %20i%0D%0A

Code:

1 REM https://rosettacode.org/wiki/Barnsley_fern5 PRINT "SVG Barnsley fern"10 HTML20 PRINT "<svg width = '640' height = '480' style = 'background-color:red;'>"30 FOR i = 1 TO 1000040 LET r = RND50 IF NOT(r > 0 AND r < .01) THEN 8060 LET x = .070 LET y = .16 * y80 IF NOT(r > .01 AND r < .08) THEN 11090 LET x = .22 * x - .26 * y100 LET y = -.23 * x + .22 * y + 1.6110 IF NOT(r > .075 AND r < .15) THEN 140120 LET x = .15 * x + .28 * y130 LET y = -.29 * x + .24 * y + .44140 LET x = .85 * x + .04 * y150 LET y = -.04 * x + .85 * y + 1.6160 LET x1 = (x + 3) * 70170 LET y1 = 700 - y * 70180 PRINT "<rect x = '"; x1; "' y = '"; y1; "' width = '1' height = '1' fill = 'green' />"190 NEXT i200 PRINT "</svg>"
Program encoded URL: https://www.lucidapogee.com/netbasic/?l ... Fsvg%3E%22

Code:

1 REM https://rosettacode.org/wiki/Archimedean_spiral5 PRINT "SVG Archimedean spiral"10 HTML20 PRINT "<svg width = '640' height = '480'>"30 LET size = 8040 LET x = 25050 LET y = 20060 LET a = 1.570 LET b = .780 FOR t = 0 TO size * PI STEP .190 LET r = a + b * t100 PRINT "<rect x = '"; r * cos(t) + x; "' y = '"; r * sin(t) + y; "' width = '1' height = '1' />"110 NEXT t120 PRINT "</svg>"
Program encoded URL: https://www.lucidapogee.com/netbasic/?l ... Fsvg%3E%22

Code:

5 PRINT "SVG curlicue"10 HTML20 PRINT "<svg width = '640' height = '480'>"30 FOR f = 0 TO 1000 STEP .140 LET x = x + SIN(f * f)50 LET y = y + COS(f * f)60 PRINT "<rect x = '"; x; "' y = '"; y; "' width = '1' height = '1' />"70 NEXT f80 PRINT "</svg>"
Program encoded URL: https://www.lucidapogee.com/netbasic/?l ... Fsvg%3E%22

Statistics: Posted by bongomeno — Thu Oct 05, 2023 9:25 pm


]]>
2023-10-05T01:37:33-05:00 2023-10-05T01:37:33-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39361#p39361 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]> They are detailed in the documentation.

Examples are updated to reflect the update.

A few New/updated examples:

Code:

1 REM https://rosettacode.org/wiki/Attractive_numbers10 FOR x = 1 TO 12020 LET n = x30 LET c = 040 IF n MOD 2 <> 0 THEN 7050 LET n = INT(n / 2)60 LET c = c + 170 IF n MOD 2 = 0 THEN 4080 FOR i = 3 TO SQR(n) STEP 290 IF n MOD i <> 0 THEN 120100 LET n = INT(n / i)110 LET c = c + 1120 IF n MOD i = 0 THEN 90130 NEXT i140 IF n <= 2 THEN 160150 LET c = c + 1160 IF NOT(PRIME(c)) THEN 180170 PRINT x,180 NEXT x

Code:

1 REM https://rosettacode.org/wiki/Nth_root10 LET a = INT(RND * 5999) + 220 PRINT "nth root of "; a; "..."30 FOR n = 1 TO 1040 LET p = .0000150 LET x = a60 LET y = a / n70 IF ABS(x - y) <= p THEN 11080 LET x = y90 LET y = ((n - 1) * y + a / y ^ (n - 1)) / n100 IF ABS(x - y) > p THEN 80110 PRINT n; " : "; y120 NEXT n

Code:

1 REM https://rosettacode.org/wiki/Catalan_numbers10 LET @(0) = 120 FOR n = 0 TO 1530 LET p = n + 140 LET @(p) = 050 FOR i = 0 TO n60 LET q = n - i70 LET @(p) = @(p) + @(i) * @(q)80 NEXT i90 PRINT n; " "; @(n)100 NEXT n

Code:

1 REM https://rosettacode.org/wiki/Prime_decomposition10 LET loops = 10020 FOR x = 1 TO loops30 LET n = x40 PRINT n; " : ";50 LET c = 060 IF n MOD 2 > 0 THEN 11070 LET n = INT(n / 2)80 LET @(c) = 290 LET c = c + 1100 IF n MOD 2 = 0 THEN 70110 FOR i = 3 TO SQR(n) STEP 2120 IF n MOD i > 0 THEN 170130 LET n = INT(n / i)140 LET @(c) = i150 LET c = c + 1160 IF n MOD i = 0 THEN 130170 NEXT i180 IF n <= 2 THEN 210190 LET @(c) = n200 LET c = c + 1210 FOR y = 0 TO c220 IF @(y) = 0 THEN 250230 PRINT @(y); " ";240 LET @(y) = 0250 NEXT y260 PRINT270 NEXT x

Code:

1 REM Prime Table10 PRINT "Generating table of primes below..."20 HTML30 PRINT "<center><table><tr>"40 FOR y = 1 TO 5050 FOR x = 1 TO 2060 LET i = i + 170 PRINT "<td style = 'border:1px solid black; background-color:yellow;'>"80 PRINT i; ":<br /> "; PRIME(i)90 PRINT "</td>"100 NEXT x110 PRINT "</tr><tr>"120 NEXT y130 PRINT "</tr></table></center>"

Statistics: Posted by bongomeno — Thu Oct 05, 2023 1:37 am


]]>
2023-09-08T16:16:54-05:00 2023-09-08T16:16:54-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39360#p39360 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]> You will have a currency conversion app on your screen.

Code:

<form action = "https://www.lucidapogee.com/netbasic/" target = "output" method = "get"><p>U<br /><input type = "text" name = "U" value = "1"><br />E<br /><input type = "text" name = "E" value = ".925881"><br />G<br /><input type = "text" name = "G" value = ".7924"><br />I<br /><input type = "text" name = "I" value = "82.628"><br />J<br /><input type = "text" name = "J" value = "145.96"></p><input type = "hidden" name = "listing" value = "1%20REM%20USD%20currency%20conversion%0D%0A10%20GET%20u%0D%0A20%20PRINT%20%22%24%22%3B%20u%3B%20%22%20USD%20%3D%22%0D%0A30%20GET%20e%0D%0A40%20GET%20g%0D%0A50%20GET%20i%0D%0A60%20GET%20j%0D%0A70%20PRINT%20u%20*%20e%3B%20%20%22%20EUR%22%0D%0A80%20PRINT%20u%20*%20g%3B%20%22%20GBP%22%0D%0A90%20PRINT%20u%20*%20i%3B%20%22%20INR%22%0D%0A100%20PRINT%20u%20*%20j%3B%20%22%20JPY%22%0D%0A"><input type = "submit"></form><iframe name = "output"></iframe>

Statistics: Posted by bongomeno — Fri Sep 08, 2023 4:16 pm


]]>
2023-09-08T15:49:10-05:00 2023-09-08T15:49:10-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39359#p39359 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>
The GET command is an advanced feature intended to be used with URL encoded programs. The command returns the contents of a variable with the same name from the URL. Variable names must be upper case in the URL.

Take this simple program and encode it to a url using the IDE on the Net Basic page.

Code:

1 REM USD currency conversion10 GET u20 PRINT "$"; u; " USD ="30 GET e40 GET g50 GET i60 GET j70 PRINT u * e;  " EUR"80 PRINT u * g; " GBP"90 PRINT u * i; " INR"100 PRINT u * j; " JPY"
Once you get the url, add the variables to the url in upper case. Notice the U=25.99&E=.925881&G=.7924&I=82.628&J=145.96 part.

Here's the URL ready to go.

https://www.lucidapogee.com/netbasic/?U ... Y%22%0D%0A

When you click the link, you will get exchange rates. Simply modify the GET variables to change the program output.

Statistics: Posted by bongomeno — Fri Sep 08, 2023 3:49 pm


]]>
2023-09-08T13:59:29-05:00 2023-09-08T13:59:29-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39358#p39358 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>
I did write a BASIC to ASM compiler called FTCBASIC, but it's very limited with only unsigned ints. It only has DO/LOOPS and ENDIF. I wouldn't mind trying to write an even better compiler or at least improving the one I already started.

Statistics: Posted by bongomeno — Fri Sep 08, 2023 1:59 pm


]]>
2023-09-08T10:14:08-05:00 2023-09-08T10:14:08-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39357#p39357 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>
Works perfectly. Always greater than 0 and less than 1. I updated your egg dropping example to reflect the change.
Neat! :D
Now you may embed Net Basic apps on any site. 8)
Also neat :shock:

If you did not already: check out Ethan Winer's BASIC Techniques and Utilities Book, it explains a lot of things about BASIC code optimization, hardware, and algorithms, but it also covers compiled BASIC code early on (that is, how BASIC is converted into assembly.) It's a hefty book (475 pages) and I'm not expecting you to read it cover to cover (I did not,) but check out the 1st chapter (pages 9 to 20.) There's also a good section on bit operations (page 48 and 49.) The following page, Ethan explains control flow. He starts with DO... LOOP and how it is converted to assembly.
The reason why I think it could be beneficial is because assembly doesn't contain many instructions; once you got those tiny elemental bricks going, you can write a pseudo-compiler to execute your code. Once you got the GOTO down, you can work on conditional jumping. And once you got this, you're gravy: it unlocks the path to condition blocks (like IF... ELSEIF... ELSE... ENDIF,) and loops (like FOR... NEXT and DO... LOOP.) It's a truly amazing read.

Statistics: Posted by MikeHawk — Fri Sep 08, 2023 10:14 am


]]>
2023-09-08T05:29:37-05:00 2023-09-08T05:29:37-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39356#p39356 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>

For example:

Code:

1 REM Prime Table2 PRINT "Generating table of primes below..."5 HTML10 PRINT "<center><table><tr>";20 PRINT "<td style = 'border:1px solid black; background-color:yellow;'>";30 LET i = i + 140 LET b = b + 150 PRINT i; ":<br /> "; PRIME(i)60 PRINT "</td>";70 IF i = 1000 THEN 12080 IF b < 20 THEN 11090 LET b = 0100 PRINT "</tr><tr>";110 IF i < 1000 THEN 20120 PRINT "</tr></table></center>"
generates this url

https://www.lucidapogee.com/netbasic/?l ... E%22%0D%0A

Look closely at the URL and you will see encoded BASIC. Click it to run the program. The interpreter decoded and executes these links taking the full page without displaying the editor. The URL is like an executable format for the interpreter.

Remote scripting in BASIC with GET requests... oh yeahhh..

Now you may embed Net Basic apps on any site. 8)

Statistics: Posted by bongomeno — Fri Sep 08, 2023 5:29 am


]]>
2023-09-08T01:29:44-05:00 2023-09-08T01:29:44-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39355#p39355 <![CDATA[General Discussion • Re: Net Basic - a BASIC in PHP]]>

Code:

rand(0, getrandmax() - 1) / getrandmax()
Changed. Works perfectly. Always greater than 0 and less than 1. I updated your egg dropping example to reflect the change.

I tried all sorts of stuff to try making it work like QBasic, but ultimately I decided it was out of the scope of what I am trying to do. I reverted everything to work like YaBasic, Just Basic, and PHP.

1 is true and 0 is false
this applies to all operator and functions

1 and 1 equals 1
not(0) equals 1
not(1) equals 0
etc..

I also had to fix some other issues. Hopefully I didn't create more in the process. 8)

Statistics: Posted by bongomeno — Fri Sep 08, 2023 1:29 am


]]>