I know, I know, this has been done before but I want to do my own.
I'm just mucking around with the maths commands used in darkbasic and here is what I have so far:
hide mouse
print "Read the Readme.txt to see what you can do."
print "You will only get a decimal if you do a square root, other wise the number will be rounded to the"
print "nearest SF."
print "All the words are in lower case, you can't make typing errors or it won't work."
print "Brackets don't work. ie (2+3)+(4-0)"
print "Press 'Esc' to exit."
sleep 1000
set cursor 1, 120
Sums:
input "What is the first number? ";A
input "Do you want to square root? ";sroot$
if sroot$="yes"
goto squareroot
endif
`get stuck in a loop where if anything is input you are taken back `to sums
input "Do you want the arc cosine, arc sine, arc tangent or none? ";arc$
goto arcsums
input "Do you want to times, divide, add or minus? ";action$
input "You'll need to give me the second number ";B
if action$ = "divide" and B = 0
print "Error, you can't divide by 0"
sleep 2000
cls
goto sums
endif
if action$="times"
C = A * B
sleep 10
print C
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
if action$="divide"
C = A / B
sleep 10
print C
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
if action$="add"
C = A + B
sleep 10
print C
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
if action$="minus"
C = A - B
sleep 10
print C
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
squareroot:
sroot#=SQRT(A)
print SQRT(A)
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * sroot#
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = sroot# / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + sroot#
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = sroot# - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
cls
goto sums
arcsums:
if arc$="arc cosine"
print acos(A)
sleep 100
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
cls
goto sums
if arc$="arc sine"
print asin(A)
sleep 100
cls
goto sums
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
if arc$="arc tangent"
print atan(A)
sleep 100
cls
goto sums
input "Do you want to store the answer for a further sum? ";answer$
if answer$="no"
cls
goto sums
endif
if answer$="yes"
input "What do you want to do to your number? times, divide, add or minus? ";actiontwo$
input "What number do you want to do that by? ";D
if actiontwo$="times"
E = D * C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="divide"
E = C / D
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="add"
E = D + C
sleep 10
print E
sleep 5000
cls
goto sums
endif
if actiontwo$="minus"
E = C - D
sleep 10
print E
sleep 5000
cls
goto sums
endif
goto sums
endif
endif
if arc$="none"
goto continuedsums
endif
I think i've put the problem as a rem in there but:
I'm doing a thing where the program returs Arc Cosine, Arc Sine, Arc Tangent (I have actually not a clue what these are or what they are used for) and they worked fine once but then I tried to do Hyperbolics and the Arcs dont work properly.
"I love to go down to the school yard and watch all the children run jump and scream... I don't think they know I'm only using blanks."