[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 2023-03-01T20:24:52-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/14896 2023-01-26T23:46:24-05:00 2023-01-26T23:46:24-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39336#p39336 <![CDATA[Re: FTCBASIC (Fast Tiny Compiled BASIC)]]>
I have added constants and libraries for shell execute and reading the command line.

Statistics: Posted by bongomeno — Thu Jan 26, 2023 11:46 pm


]]>
2023-01-08T07:42:53-05:00 2023-01-08T07:42:53-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39331#p39331 <![CDATA[Re: FTCBASIC (Fast Tiny Compiled BASIC)]]>
If you downloaded it already, delete and download it again!

I have added more libraries and updated the examples.

This is a major update, but I will still keep this as alpha version.

libraries added are time.inc and random.inc

Statistics: Posted by bongomeno — Sun Jan 08, 2023 7:42 am


]]>
2023-01-07T01:52:12-05:00 2023-01-07T01:52:12-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39330#p39330 <![CDATA[Re: FTCBASIC (Fast Tiny Compiled BASIC)]]>
I have added a file access library.

Statistics: Posted by bongomeno — Sat Jan 07, 2023 1:52 am


]]>
2023-03-01T20:24:52-05:00 2023-01-06T01:02:50-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39329#p39329 <![CDATA[FTCBASIC (Fast Tiny Compiled BASIC)]]>

FTCBASIC

Homepage: http://lucidapogee.com/index.php?page=ftcbasic

FTCBASIC means fast tiny compiled BASIC. It is a BASIC compiler for x86 DOS. The compiler is written in QuickBasic and generates FASM output. Using batch files, you may compile your source to com files instantly.

Generated com files are tiny and fast. They start at less than 50 bytes.

The compiler and language is derived from the Pebble language. Many of the great features of Pebble have been kept in translation. As a result, there's support for inline asm, include files, and more. There's even some basic 1D array and string data type support.

In all, there's integer, integer array, and string data types. Floating point is not supported, but may be implemented with libraries.

Only unsigned integers may be used in expressions. Operator precedence is *, /, +, -, <, >, <=, >=, =, <>, AND, and OR. Parenthesis override operator precedence.

** Notice: This Alpha version is fresh off the press and probably has issues. Also, the documentation is incomplete. I will be working on it, but wanted to make an early release to get some feedback. **

Examples...

Code:

rem periodic table lookup examplerem uses carry command to perform modulusrem compile with FTCBASICdefine e = 0, i = 0, m = 0, r = 0, c = 0, q = 0dim a[1, 2, 5, 13, 57, 72, 89, 104]dim b[-1, 15, 25, 35, 72, 21, 58, 7]doclsprint "Periodic Table Lookup"crlfprint "0 to continue or 1 to quit: " \input qclsif q = 0 thengosub displaytablegosub searchtablecrlfprint "Press any key to continue..."pauseendifloop q <> 1endsub searchtableprint "Atomic number: " \input elet i = 8dolet i = i - 1loop @a[i] > elet m = e + @b[i]let r = ( m / 18 ) + 1carry clet c = c + 1cursor 19,20print "Period: " \print r \print " Group: " \print c \crlfreturnsub displaytableprint "      1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18"crlfprint "   1  H                                                                   He"crlfprint "   2  Li  Be                                          B   C   N   O   F   Ne"crlfprint "   3  Na  Mg                                          Al  Si  P   S   Cl  Ar"crlfprint "   4  K   Ca  Sc  Ti  V   Cr  Mn  Fe  Co  Ni  Cu  Zn  Ga  Ge  As  Se  Br  Kr"crlfprint "   5  Rb  Sr  Y   Zr  Nb  Mo  Tc  Ru  Rh  Pd  Ag  Cd  In  Sn  Sb  Te  I   Xe"crlfprint "   6  Cs  Ba  *   Hf  Ta  W   Re  Os  Ir  Pt  Au  Hg  Tl  Pb  Bi  Po  At  Rn"crlfprint "   7  Fr  Ra  **  Rf  Db  Sg  Bh  Hs  Mt  Ds  Rg  Cn  Nh  Fl  Mc  Lv  Ts  Og"crlfprint "   8 Lantanoidi*  La  Ce  Pr  Nd  Pm  Sm  Eu  Gd  Tb  Dy  Ho  Er  Tm  Yb  Lu"crlfprint "   9 Aktinoidi**  Ac  Th  Pa  U   Np  Pu  Am  Cm  Bk  Cf  Es  Fm  Md  No  Lr"crlfreturn

Code:

rem Nim game examplerem compile with FTCBASICdefine tokens = 12, take = 0gosub introdoprint "There are " \print tokens \print " tokens remaining."crlfprint "How many would you like to take? " \input takeif take > 3 or take < 1 thenprint "You must take between 1 to 3 tokens."endifif tokens - take < 0 thenprint "You cannot take that many."endifif take <= 3 and take >= 1 and tokens - take >= 0 thenlet tokens = tokens - takeif tokens = 0 thenbellprint "Congratulations. You got the last token."pauseendendiflet take = 4 - takeif tokens >= 15 thenlet take = 3endifif tokens <= 3 thenlet take = tokensendifprint "I will take " \print take \print " of the tokens."let tokens = tokens - takeif tokens = 0 thenprint "I got the last token. I win. Better luck next time."pauseendendifendifloopsub introclsprint "NIM game"crlfprint "Press any key to play..."clsreturn

Code:

rem bubble sort benchmark examplerem compile with FTCBASICuse time.incuse random.incdefine const size = 32000dim list[size]define sorting = 0, index = 0, elements = 0define timestamp = 0, sorttime = 0define temp1 = 0, temp2 = 0clsprint "Bubble sort benchmark test"doprint "How many elements to generate and sort (max " \print size \print ")? " \input elementsloop elements > sizegosub fillgosub sortprint "done!"print "sort time: " \print sorttimeprint "Press any key to view sorted data..."pausegosub outputpauseendsub fillprint "filling..."0 indexdogosub generaterandlet @list[index] = rand+1 indexloop index < elementsreturnsub sortprint "sorting..."gosub systemtimelet timestamp = loworderdo0 sorting0 indexdolet temp1 = index + 1if @list[index] > @list[temp1] thenlet temp2 = @list[index]let @list[index] = @list[temp1]let @list[temp1] = temp2let sorting = 1endif+1 indexloop index < elements - 1loop sorting = 1gosub systemtimelet sorttime = ( loworder - timestamp ) / 18returnsub outputprint "printing..."0 indexdoprint @list[index]+1 indexloop index < elementsreturn

Statistics: Posted by bongomeno — Fri Jan 06, 2023 1:02 am


]]>