Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias math_operators [+ - * divf]
- alias noob_operator_names [plus minus times "divided by"]
- alias numbers [0 1 2 3 4 5 6 7 8 9]
- initialize [quiz_correct quiz_incorrect] 0
- alias quizme [
- if (strcmp $arg1 c) [alias quiz_correct 0; alias quiz_incorrect 0; echo Your quiz scores have been cleared.] [
- alias first_num []
- alias second_num []
- alias operator (at $math_operators (rnd 4))
- alias opp (findlist $math_operators $operator)
- loop fnl $arg1 [
- alias first_num (concatword $first_num (at $numbers (rnd 10)))
- ]
- loop snl $arg1 [
- alias second_num (concatword $second_num (at $numbers (rnd 10)))
- ]
- if (strcmp $operator divf) [
- if (> $second_num $first_num) [tmp_quiz_number = $first_num; first_num = $second_num; second_num = $tmp_quiz_number]
- ]
- alias answer ($operator $first_num $second_num)
- echo What is $first_num (at $noob_operator_names $opp) (concatword $second_num "?") Use the /ans command to give your answer...
- ]
- ]
- alias ans [
- if (|| (strcmp $answer $arg1) (strcmp $answer (concatword $arg1 ".0"))) [
- echo Correct!
- += quiz_correct 1
- ] [
- echo Incorrect!
- += quiz_incorrect 1
- ]
- echo The answer was: $answer || Your new scores are: $quiz_correct correct, $quiz_incorrect incorrect total answers...
- ]
- docsection [Math Quiz];
- docident [quizme] [Generates a random math question for you to answer.];
- docargument [S] [The size (in digits) of the numbers used in the questions of the script.];
- docexample [/quizme 1] [Example output: What is 3 times 6?];
- docexample [/quizme 2] [Example output: What is 16 plus 84?];
- docremark [If you use a single lowercase "c" as the first argument for this command, your total quiz scores will be "zero'd."];
- docident [ans] [Allows you to answer questions asked by the /quizme command.];
- docargument [A] [Your answer to the last question asked.];
- docexample [Previous question: What is 3 plus 9?] [/ans 12];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement