I'm working on a self-project called 'Project Calculus' (Not that you care about the name). It's a huge calculator that works cross-platform and only uses 'already implemented' modules (So no SymPy, no NumPy, no SciPy, et cetera.) in it.

I need help (If you even bother to cooperate with a newb x]), and here is what I need help on.

- replacing variables with something else, like this:

``````x = x-4
# Say you have x^2 - 4*x. Now replace all x with (x-4).
# I would like the result to be something like (x-4)^2 - 4*(x-4).``````

- simplify algebraic expressions:

``````(x-4)^2-4*(x-4)
# Simplify this to get -12*x+32+x^2.``````

- rearrange expressions to proper degree order:

``````-12*x+32+x^2
# Change to x^2-12*x+32``````

Obviously, 90% of you would not want to help me on such an absurd script, also because I'm a beginner. But I'd appreciate help, and if I appreciate your posts, I would be happy to add you to the credits. x]

So, uh... I don't necessarily care about the 3rd (rearranging order by degree). That's perfectly optional. :P

Also, if you have something like "do it yurself, i dunt care", your statement shall be ignored. If you say "Do some work" and not give me a code (even a tiny snippet), fine by me. All depends on whether your tip was useful. If you say "This is not a project for a beginner", I understand. But I do have experience with Python (although very limited).

If you think I'm trying to think I'm trying to boss all you around, I'm not. Whether you help me or not is all up to you. I'll admit I'm kind of self-centered, though. >.>

So, um.... I'll end this post now.

First of all, I think we need more information why you are playing around with some variable names, as we do use variables to store values, and values are what we care about, not how they look. So, say you get a value from the user, store it in X and then do whatever you want to it!!!!! x - 4 then to the power of 2, one by one. I guess that's the notion of arithmetic operation and you use probably, "Divide and conquer" to solve one by one. (X^2)-4*(X-2) or something similar is merely performing operation on X.

By the way, please stop writing diaries on your post. We are interested in your problem, code and related... Not how you feel, how you credit people and so on.

Thank you

It sounds to me as if you want to either recreate something like Matlab or something like a spread sheet.

As an exercise, this seems very large. As a tool, there are probably freely available ones already in existence. Look here: http://www.CJFearnley.com/higher.math.and.open.source.pdf (see my signature).

group: Primary part is second part of my help request. :P

griswolf: Err... yes, but this isn't really a 'tool'. Just call it an all-in-one. Tool + Boredom Killer + Frustration Pill + Python Practice + Extra Credit in Grades thing. x]

So I'd like most of the help to be focused on the second part.

Oh, gawd, finally got it figured out. >.>

Sorry for making you think.

I might make more help threads later...

:P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.