I have this in a state where I think I can show off some of it. Here's a calculator portion of the thing I'm working on. I'm working in C, and the code isn't in a state that I want to release it.
It's an eight digit decimal calculator. It uses infix notation. It is only a four-function calculator, though, but you can put parenthesis in. In the zip file is also the same program compiled for Windows (it is a C program after all). Just type in an expression and hit enter. It doesn't prompt you or anything. If you hit enter with a blank line, the program ends (or, if the line only has one character in it; I tried to fix that).
The numbers only truncate. The exponent range is small. The decisions for how to print numbers are arbitrary.
Try It Now!
#R42
Infix calculator
Forum rules
This section is for testing Commander X16 programs and programs related to the CX16 for other platforms (compilers, data conversion tools, etc.)
Feel free to post works in progress, test builds, prototypes, and tech demos.
Finished works go in the Downloads category. Don't forget to add a hashtag (#) and the version number your program was meant to run on. (ie: #R41).
This section is for testing Commander X16 programs and programs related to the CX16 for other platforms (compilers, data conversion tools, etc.)
Feel free to post works in progress, test builds, prototypes, and tech demos.
Finished works go in the Downloads category. Don't forget to add a hashtag (#) and the version number your program was meant to run on. (ie: #R41).
- TediusTimmy
- Posts: 15
- Joined: Tue Apr 25, 2023 3:54 am
Infix calculator
- Attachments
-
- CalcDemo.zip
- Zip file containing program in PRG form and also Windows executable, for the brave. (With fixed manifest extension.)
- (33.07 KiB) Downloaded 195 times
-
- Screenshot of it running in emulator.
- ScreenShot.png (6.82 KiB) Viewed 3187 times
Last edited by TediusTimmy on Fri May 05, 2023 1:09 am, edited 1 time in total.
Re: Infix calculator
Try It Now doesn't work for me, but normally Try It Now works for me. I use Chromium in most updated Debian 11 Bullseye (aarch64) for Raspberry Pi 4B. Maybe it's because you included a Windows version and that might make the file too big. That's just one hypothesis.
Re: Infix calculator
Try it now failed using Safari 16.4.1 on Mac OS 12.6.5 It may be the emulator is having an issue.
Looking via Safari's web inspector
Looking via Safari's web inspector
- Attachments
-
- Screen Shot 2023-05-03 at 4.05.34 PM.png (49.79 KiB) Viewed 3095 times
-
- Screen Shot 2023-05-03 at 4.05.21 PM.png (111.3 KiB) Viewed 3095 times
-
- Screen Shot 2023-05-03 at 4.04.29 PM.png (58.85 KiB) Viewed 3095 times
Re: Infix calculator
TediusTimmy, manifest file should have json extention, not txt. So emulator is just ignoring your manifest, and loads all files from zip, then runs prg file. It's fine, but I think it's not what you wanted to do. )
Also I noticed that emulator not always runs the program. Seems there is problem with some async call, I'll look into it.
Also I noticed that emulator not always runs the program. Seems there is problem with some async call, I'll look into it.
- TediusTimmy
- Posts: 15
- Joined: Tue Apr 25, 2023 3:54 am
Re: Infix calculator
@Cyber - Thank you. I forgot to rename the manifest file and never noticed. It should now be fixed in the OP.
I am going to also reupload it as the program file. If the other one fails, try this one.
Try It Now!
I am going to also reupload it as the program file. If the other one fails, try this one.
Try It Now!
- Attachments
-
- calc-later.prg
- Mostly the same as the other. There may be a few differences.
- (17.57 KiB) Downloaded 236 times
Re: Infix calculator
I got both to work with Try It Now, but I had to press F9 many times to get the keyboard layout I use: en-gb. Otherwise I couldn't enter +, * etc. In the latest ROM after R42 F9 doesn't seem to work to change keyboard and I need to set keyboard layout using KEYMAP "EN-GB", but you cannot use KEYMAP in programs that start using Try It Now. Try It Now tries to identify the keyboard using the preferred language in the browser, but that doesn't match the keyboard in my case.
Re: Infix calculator
You can change the layout with the "menu" command and then "keyboard layout".mobluse wrote: ↑Sun May 07, 2023 1:09 pm I got both to work with Try It Now, but I had to press F9 many times to get the keyboard layout I use: en-gb. Otherwise I couldn't enter +, * etc. In the latest ROM after R42 F9 doesn't seem to work to change keyboard and I need to set keyboard layout using KEYMAP "EN-GB", but you cannot use KEYMAP in programs that start using Try It Now. Try It Now tries to identify the keyboard using the preferred language in the browser, but that doesn't match the keyboard in my case.
Edit: Nevermind, I just tried it in the web emu and it doesn't seem to work.... I guess that was added after R42.