TGC Codebase Backup



Math by Scimitar Products

14th Jan 2005 21:28
Summary

Made a math program for math class. Wanted to make one with out using functions (plus I'm no good at that). The program does addition, subtraction, division, multiplcation, perimet



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem print instructions
print "Please input operation type."
suspend for key
cls
begin:
set cursor 50,50
print "Press mouse button 1 (perimeter), button 2 (area),"
set cursor 65,65
print "return (subtraction), space (addition),"
set cursor 80,80
print "shift (multiplcation), ctrl (division)."

rem goto programs
repeat
if mouseclick()=1
gosub Ps
endif
if mouseclick()=2
goto A
endif
if returnkey()=1
goto S
endif
if spacekey()=1 
goto Ad
endif
if shiftkey()=1
goto M
endif
if controlkey()=1
goto D
endif
until escapekey()=1

end

rem programs
PS:
cls
input "p=>";p#
cls
Ps# = p# + p# + p# + p#
set cursor 50,50
print Ps#
suspend for key
cls
goto begin

A:
cls
input "l=>";l#
input "w=>";w#
cls
A# = l# * w#
set cursor 50,50
print A#
suspend for key
cls
goto begin

Ad:
cls
print "a+b"
input "a>";a#
input "b>";b#
cls
A# = a# + b#
set cursor 50,50
print A#
suspend for key
cls
goto begin

S:
cls
print "c-d"
input "c>";c#
input "d>";d#
cls
S# = c# - d#
set cursor 50,50
print S#
suspend for key
cls
goto begin

D:
cls
print "e/f"
input "e>";e#
input "f>";f#
cls
D# = e# / f#
set cursor 50,50
print D#
suspend for key
cls
goto begin

M:
cls
print "g*h"
input "g>";g#
input "h>";h#
cls
M# = g# * h#
set cursor 50,50
print M#
suspend for key
cls
goto begin