Heya Ax,
I''ll send you my code for the recursive descent parser via email.
Basically, the way it works is that it takes each item from the string and breaks it up into a node in a list. (ignoring spaces).
Then it iterates through the list making sure that each node has an operation or number that is appropriate for what came before it.
That''s the code to verify the equations. It''s approximately: 2N = O(N)
After that is the code to calculate the expression. It goes through the list recursively by order of operation looking for add/subtract or multiply/divide operators. If you have other questions email me or post it here.
Best Regards,
Jeromy Walsh
Programmer
Liquid Entertainment
------------------------
"The question isn''t how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" -Boondock Saints
Math issues...
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement