This code can solve math problems for you. Ye know like:
numbers are: 75, 5, 2, 10, 15, 3
do something with those to get: 887.5
it only works with 6 numbers and 1 answer though. In the problem above, it calculates this in 2 sec:
75 * 5 = 375
375 / 2 = 187.5
187.5 - 10 = 177.5
177.5 * 15 = 2662.5
2662.5 / 3 = 887.5!
im working on a better version now
this code will calculate it for you:
sync on
sync rate 0
answer# as double float
v# as double float
dim n(6)
dim s$(4)
dim nr#(6)
print "t"
cls
print "t"
cls
text 5,5,"t"
cls
sync
print "Terrible Math solver -Emperor-Baal-"
print "First, put in the 6 numbers required: "
input "Number 1: ", buffer
n(1)=buffer
input "Number 2: ", buffer
n(2)=buffer
input "Number 3: ", buffer
n(3)=buffer
input "Number 4: ", buffer
n(4)=buffer
input "Number 5: ", buffer
n(5)=buffer
input "Number 6: ", buffer
n(6)=buffer
print "Thank you, now type the answer that has to be found"
input "answer (float number): ", answer#
cls
s$(1)=" + "
s$(2)=" - "
s$(3)=" * "
s$(4)=" : "
time = timer()
for n1 = 1 to 6
for n2 = 1 to 6
for n3 = 1 to 6
for n4 = 1 to 6
for n5 = 1 to 6
for n6 = 1 to 6
for s1 = 1 to 2
for s2 = 1 to 2
for s3 = 1 to 2
for s4 = 1 to 2
for s5 = 1 to 2
if n1 <> n2 and n1 <> n3 and n1 <> n4 and n1 <> n5 and n1 <> n6
if n2 <> n3 and n2 <> n4 and n2 <> n5 and n2 <> n6
if n3 <> n4 and n3 <> n5 and n3 <> n6
if n4 <> n5 and n4 <> n6
if n5 <> n6
for a=1 to 4
for b=1 to 4
for c=1 to 4
for d=1 to 4
for e=1 to 4
v# = n(n1)
if s1 = 1
if a=1 then v# = v# + n(n2)
if a=2 then v# = v# - n(n2)
if a=3 then v# = v# * n(n2)
if a=4 then v# = v# / n(n2)
else
if a=1 then v# = v# + n(n2)
if a=2 then v# = n(n2) - v#
if a=3 then v# = v# * n(n2)
if a=4 then v# = n(n2) / v#
endif
nr#(1)=v#
if s2 = 1
if b=1 then v# = v# + n(n3)
if b=2 then v# = v# - n(n3)
if b=3 then v# = v# * n(n3)
if b=4 then v# = v# / n(n3)
else
if b=1 then v# = v# + n(n3)
if b=2 then v# = n(n3) - v#
if b=3 then v# = v# * n(n3)
if b=4 then v# = n(n3) / v#
endif
nr#(2)=v#
if s3 = 1
if c=1 then v# = v# + n(n4)
if c=2 then v# = v# - n(n4)
if c=3 then v# = v# * n(n4)
if c=4 then v# = v# / n(n4)
else
if c=1 then v# = v# + n(n4)
if c=2 then v# = n(n4) - v#
if c=3 then v# = v# * n(n4)
if c=4 then v# = n(n4) / v#
endif
nr#(3)=v#
if s4 = 1
if d=1 then v# = v# + n(n5)
if d=2 then v# = v# - n(n5)
if d=3 then v# = v# * n(n5)
if d=4 then v# = v# / n(n5)
else
if d=1 then v# = v# + n(n5)
if d=2 then v# = n(n5) - v#
if d=3 then v# = v# * n(n5)
if d=4 then v# = n(n5) / v#
endif
nr#(4)=v#
if s5 = 1
if e=1 then v# = v# + n(n6)
if e=2 then v# = v# - n(n6)
if e=3 then v# = v# * n(n6)
if e=4 then v# = v# / n(n6)
else
if e=1 then v# = v# + n(n6)
if e=2 then v# = n(n6) - v#
if e=3 then v# = v# * n(n6)
if e=4 then v# = n(n6) / v#
endif
nr#(5)=v#
if v# = answer#
text 5,5,"Number: "+str$(answer#)
text 5,20,"Was found using this calculation: "
text 5,35,str$(n(n1))+s$(a)+str$(n(n2))+" = "+str$(nr#(1))
text 5,50,str$(nr#(1))+s$(b)+str$(n(n3))+" = "+str$(nr#(2))
text 5,65,str$(nr#(2))+s$(c)+str$(n(n4))+" = "+str$(nr#(3))
text 5,80,str$(nr#(3))+s$(d)+str$(n(n5))+" = "+str$(nr#(4))
text 5,95,str$(nr#(4))+s$(e)+str$(n(n6))+" = "+str$(nr#(5))
text 5,110,str$(calc-1)+" calculations were done before this one"
text 5,125,"Time took to find answer: "+str$(timer()-time)+"ms."
sync
wait key
end
endif
inc calc
next e
next d
next c
next b
next a
endif : endif : endif : endif : endif
next s1
next s2
next s3
next s4
next s5
next n6
next n5
next n4
next n3
next n2
next n1
text 5,5,"Number: "+str$(answer#)
text 5,20,"Was NOT found, the last calculation returned: "+str$(nr#(5))
text 5,110,str$(calc-1)+" calculations were done before this one"
text 5,125,"Time wasted: "+str$(timer()-time)+"ms."
sync
wait key
end
function p$(v#,n6,e)
if e=1 then v# = v# + n(n6)
if e=2 then v# = v# - n(n6)
if e=3 then v# = v# * n(n6)
if e=4 then v# = v# / n(n6)
endfunction v#