Solution
Challenges » Solution
Name: PSADME Author: Edward Hou Download: Challenge6.8xp Compatibility: Parent page not set File Size: 599 bytes |
Parses expressions using mixed-up precedence rules. |
Want to update this page?
- Upload new files to provide up-to-date versions of your program;
- or Edit the content of this page to provide up-to-date information about your program.
A moderator will only process these changes if you add the word update to the list of tags
What the community thinks:
Here is a copy-and-paste from SourceCoder 2 (copyright Cemetech 2005)
I'm not sure how to add source code to the program.
by which you mean that you're not sure how to modify the program within sourcecoder? Just hit the "export as .8xp" button…
I mean I'm not sure how to add the source code to this page, as if I had submitted source code instead of a program file.
I just got a working program, so I'll just post it now and finish it later. This accomplishes the task but does not do whatever is in parentheses first, and does not respect special functions like x√ yet. These are simple fixes, though. Take the quote off the "Pause Str1 to see each step. It adds a ton of parentheses so that there are more around the earlier operations. This program is also versatile in that changing the order of the characters in Str0 changes the order of operations, so changing Str0 to "²‾ֿ¹^×÷+-" would actually just evaluate the expression with the regular order of operations.
It's kinda funny to look at Str1 after the program has finished on an input of "1+2-3×4÷5^6".
Eh, I'd need to ask James how he wants it done. James?
/Socks
Well, if you click "show more" or whatever it says under Challenge 7, the table for program uploads show. On the end of the table, there is a spot for submitting a code instead of program file.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me