`The beginning :D
begin:
Input "Equation: ",q$
 
`Locate variable
variable# = 0
Repeat
   Inc variable#
   variable$ = mid$(q$,variable#)
Until variable$ = "x"
 
`Locate equals sign
equals# = 0
Repeat
   Inc equals#
   equals$ = mid$(q$,equals#)
Until equals$ = "="
 
`Is variable on the right or left side of equals sign?
If variable# > equals#
   variable$ = right$(q$,len(q$)-equals#)
   variable$ = left$(variable$,len(variable$)-1)
   otherhalf$ = left$(q$,equals#-1)
Else
   variable$ = left$(q$,variable#-1)
   otherhalf$ = right$(q$,len(q$)-equals#)
Endif
 
`Answer equals the non-variable side divided by the variable side
answer$ = str$(val(otherhalf$)/val(variable$))
 
`Print the answer and start over
print answer$
goto begin: