-- Header
function ShowHeader()
EchoLine("===GameSuite Calculator===");
EchoLine("== A calculator made with GameSuite :D!");
EchoLine("");
end
-- Show the header
ShowHeader();
-- Get A
Echo("Enter first value > ");
A = GetLine();
-- Get B
EchoLine("");
EchoLine("");
Echo("Enter second value > ");
B = GetLine();
-- Echo the problem
Echo(A);
Echo(" + ");
Echo(B);
Echo(" = ");
Echo( (A + B) );
EchoLine("");
EchoLine("");
-- Check if we should output the console log
Echo("Output the console log? (Y/N) > ");
outputLog = GetLine();
if ( outputLog == "Y") or ( outputLog == "y" ) then
EchoLine("");
Echo("File to output log to > ");
outputFile = GetLine();
if ( outputFile == "" ) then
Error("Incorrect filename, using console.log instead.");
FlushConsole("console.log");
else
FlushConsole(outputFile);
end
end
-- Wait for the user to press a key
EchoLine("");
EchoLine("Press any key to exit...");
WaitForKey();