RP1 Scientific Calculator in PHP

Anything PHP related.
Post Reply
admin
Site Admin
Posts: 67
Joined: Wed Feb 22, 2023 6:51 am

RP1 Scientific Calculator in PHP

Post by admin »

RP1

(R)PN (P)HP 1

Based on the expression evaluation system for Net Basic, I made a nice calculator.
It has input for 26 variables that are persistent in the browser along with the expression.

https://lucidapogee.com/rp1
admin
Site Admin
Posts: 67
Joined: Wed Feb 22, 2023 6:51 am

Re: RP1 Scientific Calculator in PHP

Post by admin »

I have updated the print command. It now acce3pt expressions and quoted literal text that may be separated by semicolons or commas. The semicolon combines output with no space. The comma adds 8 non breaking spaces to roughly simulate a tab since displaying tabs is difficult in html. A trailing semicolon causes the next print to output on the same line. A trailing comma does the same, but with the spacing.

My goal was to make this version of Basic more compatible with ISO standards. This way code will copy/paste to/from say Qbasic with even less fuss.

Right now, the only incompatibilities with Qbasic are the RND function returns different values based on the PHP rnd function. NOT(0) operator returns 1 like PHP and Yabasic unlile Qbasic, Freebasic, Craft Basic, etc. For now I made sure AND and OR return -1 on true. The usage of @() for the single one dimensional array is inspired by Palo Alto like Tiny Basic dialects and would need to be replaced with a letter to work in Qbasic.
Post Reply