Share your repls and programming experiences

← Back to all posts
Algebra Calculator
GavinSwanson (5)

A single variable calculator. You need to have two sides of the equal sign, and you can put as many x's as you want. You have to separate the variables from the numbers with an *, or else it will pop up with an error, and no spaces. Other than that, it's pretty easy.

Comments
hotnewtop
XanthusPettitt (7)

hey can you explain this to me bc im having a really hard time reading the code

GavinSwanson (5)

@XanthusPettitt
So, the way I designed this was I made it so that it goes through every value of x until the equation is true, but I think I messed it up a while ago. I can try to revert it to its original state, where it is much easier to understand. And you also had to put double equals signs

XanthusPettitt (7)

@GavinSwanson oh thats a nice way to do it im trying to do a x calc and im having a little bit of trouble but that helps thanks!

GavinSwanson (5)

@XanthusPettitt
So, I can't really figure out what went wrong in this code, and to me, this should work. If you're good with calcs, could you tell me where I went wrong?

XanthusPettitt (7)

@GavinSwanson umm sure lemme copy it to get a better look

XanthusPettitt (7)

@GavinSwanson I think its because the answer might be more percise than 2 digits past the decimal point so its skipping it

XanthusPettitt (7)

@GavinSwanson also x could be bigger than 101

XanthusPettitt (7)

@GavinSwanson oh yeah and with furthermore the if statment is a correct one as no syntax error but I dont think it will ever be true

XanthusPettitt (7)

@GavinSwanson you can also check if there is an 'x' or an 'X'

XanthusPettitt (7)

@GavinSwanson sorry im probably bombarding you with messages ill stop now