Results 1 to 15 of 15

Thread: SCAR Mathematics Quiz!

  1. #1
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default SCAR Mathematics Quiz!

    Mathematics Quiz in SCAR
    By Dan's The Man

    Simple to set-up, run the script and have fun answering those mathematical questions

    Currently supports:
    • Multiplication
    • Division
    • Addition
    • Subtraction
    • Exponent


    Sample debug output for 5 questions:
    1) Correct! 3 + 3 = 6
    2) Wrong... 3 + 5 does not equal 7. 3 + 5 = 8
    3) Correct! 3^2 = 9
    4) Wrong... 8 / 7 does not equal 0.2. 8 / 7 = 1.14
    5) Wrong... 3 + 4 does not equal 8. 3 + 4 = 7

    scar Code:
    (*
       Maths Quiz by Dan's The Man (Mayazcherquoi).
       
       Answer the maths questions provided as quick as possible.
       
       Setup lines 12 to 15 :-), run the script and enjoy!
    *)


    program QuizMaths;

    const
      QstLimit = 5;    //How Many Questions? NOTE: The more questions, the harder they are.
      DifLevel = 5;     //Difficulty level? 1 = +; 2 = +-; 3 = +-*; 4 = +-*/;
        //Max DifLevel is 10. 5 and above uses to the power. The higher the DifLevel from
        //5, the harder it is to calculate the answer if it's to the power.
      Timing = True;    //Time your results?

    var
      i, dL, i1, i2, dP, tI: Integer;
      Ans: Extended;
      s, bs: String;
      TIA: TExtendedArray;
     
    //Returns the fractional part of the parametre X.
      //e.g: X = 1.2, Result := 0.2.
    function Frac(const X: Extended): Extended;
    begin
      Result := X - Int(X);
    end;

    //Converts parametre X to D decimal places.
    function ToDecPla(X: Extended; D: Integer): Extended;
    var
      n, bX: Extended;
    begin
      n := Pow(10, d);
      bX := x * n;
      Result := (Int(bX) + Int(Frac(bX) * 2)) / n;
    end;

    var
      ra: Extended;

    begin
      ClearDebug;
      SetLength(TIA, QstLimit);
      dL := DifLevel;
      if(dL > 10) then
        dL := 10;
      if(dL < 1) then
        dL := 1;
      for i := 1 to QstLimit do
      begin
        i1 := (RandomRange(1, i + QstLimit - (Random(3)))) + 1;
        i2 := (Random(i + QstLimit)) + 1;
        case (Random(dL) + 1) of
          1:
          begin
            bS := (IntToStr(i1)) +
              ' + ' + (IntToStr(i2));
            Ans := i1 + i2;
          end;
          2:
          begin
            bS := (IntToStr(i1)) +
              ' - ' + (IntToStr(i2));
            Ans := i1 - i2;
          end;
          3:
          begin
            bS := (IntToStr(i1)) +
              ' * ' + (IntToStr(i2));
            Ans := i1 * i2;
          end;
          4:
          begin
            if(i1 = 0) then
              i1 := 1;
            bS := (IntToStr(i1)) +
              ' / ' + (IntToStr(i2));
            Ans := i1 / i2;
          end;
          5..10:
          begin
            while (i1 > dL) do
              i1 := i1 - dL;
            while (i2 > dL) do
              i2 := i2 - dL;
            bS := (IntToStr(i1)) + '^' +
              (IntToStr(i2));
            Ans := Round(Pow(i1, i2));
          end;
        end;
        if(Timing) then
          TIA[i - 1] := GetSystemTime;
        s := Readln(bs);
        if(Timing) then
          TIA[i - 1] := GetSystemTime - TIA[i - 1];
        dP := (Length(s)) - (Pos('.', s));
        ra := ToDecPla(StrToFloatDef(s, -1234567890), 2);
        if(ToDecPla(Ans, 2) = ra) then
          Writeln(IntToStr(i) + ') Correct! ' + bS + ' = ' + FloatToStr(ToDecPla(Ans, 2))) else
            if(ra = -1234567890) then
              Writeln(IntToStr(i) + ') You didn'#39't even attempt to answer ' + bS + '.   The answer would'#39've been ' + FloatToStr(ToDecPla(Ans, 2))) else
                Writeln(IntToStr(i) + ') Wrong... ' + bS + ' does not equal ' +
                  FloatToStr(ra) + '. ' + bS + ' = ' + FloatToStr(ToDecPla(Ans, 2)));
        if(Timing) then
          Writeln('It took you ' + FloatToStr(TIA[i - 1]) + ' milliseconds to answer that question.');
      end;
      if(Timing) then
      begin
        Writeln('Your average time to answer those ' + IntToStr(QstLimit) + ' questions was:');
        Writeln('  ' + IntToStr(Round(Average(TIA))) + ' milliseconds.');
      end;
    end.

    Enjoy and post your results
    Last edited by Daniel; 08-11-2009 at 06:31 PM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  2. #2
    Join Date
    Mar 2008
    Location
    The Netherlands
    Posts
    1,395
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    1) You didn't even attempt to answer 4 / 3. The answer would've been 1,33
    It took you 2313 milliseconds to answer that question.
    2) Correct! 5^4 = 625
    It took you 8343 milliseconds to answer that question.
    3) Correct! 3 / 6 = 0,5
    It took you 3907 milliseconds to answer that question.
    4) Correct! 2 + 4 = 6
    It took you 1531 milliseconds to answer that question.
    5) Correct! 9 + 9 = 18
    It took you 1312 milliseconds to answer that question.
    Your average time to answer those 5 questions was:
    3481 milliseconds.
    Successfully executed


    Bah @ question 1.


  3. #3
    Join Date
    May 2007
    Location
    Sydney, Australia (Faggot Region)
    Posts
    1,465
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Your average time to answer those 5 questions was:
    291 milliseconds.
    Successfully executed


  4. #4
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Simtoon View Post
    Your average time to answer those 5 questions was:
    291 milliseconds.
    Successfully executed
    Care to give the rest of the debug info?
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  5. #5
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol I had the easiest questions :P

    PHP Code:
    1Correct6
    It took you 1157 milliseconds to answer that question
    .
    2Correct4^16
    It took you 2187 milliseconds to answer that question
    .
    3Correct11
    It took you 1234 milliseconds to answer that question
    .
    4Correct14
    It took you 1750 milliseconds to answer that question
    .
    5Correct10 = -1
    It took you 2985 milliseconds to answer that question
    .
    Your average time to answer those 5 questions was:
      
    1863 milliseconds.
    Successfully executed 
    I could have done them a lot faster but I was doing other stuff also :P

  6. #6
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Mathematics View Post
    Lol I had the easiest questions :P

    PHP Code:
    1Correct6
    It took you 1157 milliseconds to answer that question
    .
    2Correct4^16
    It took you 2187 milliseconds to answer that question
    .
    3Correct11
    It took you 1234 milliseconds to answer that question
    .
    4Correct14
    It took you 1750 milliseconds to answer that question
    .
    5Correct10 = -1
    It took you 2985 milliseconds to answer that question
    .
    Your average time to answer those 5 questions was:
      
    1863 milliseconds.
    Successfully executed 
    I could have done them a lot faster but I was doing other stuff also :P
    +1

    1) Correct! 4 - 4 = 0
    It took you 1466 milliseconds to answer that question.
    2) Correct! 2 * 2 = 4
    It took you 1341 milliseconds to answer that question.
    3) Correct! 2 + 1 = 3
    It took you 1123 milliseconds to answer that question.
    4) Correct! 7 * 7 = 49
    It took you 2449 milliseconds to answer that question.
    5) Correct! 8 + 10 = 18
    It took you 1295 milliseconds to answer that question.
    Your average time to answer those 5 questions was:
    1535 milliseconds.
    Nice script

    Simtoon -

    Your average time to answer those 5 questions was:
    153 milliseconds.
    EDIT: No I did not just take a 5 off the first one
    Last edited by Runescapian321; 08-11-2009 at 08:07 PM.

  7. #7
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Mathematics View Post
    Lol I had the easiest questions :P

    PHP Code:
    1Correct6
    It took you 1157 milliseconds to answer that question
    .
    2Correct4^16
    It took you 2187 milliseconds to answer that question
    .
    3Correct11
    It took you 1234 milliseconds to answer that question
    .
    4Correct14
    It took you 1750 milliseconds to answer that question
    .
    5Correct10 = -1
    It took you 2985 milliseconds to answer that question
    .
    Your average time to answer those 5 questions was:
      
    1863 milliseconds.
    Successfully executed 
    I could have done them a lot faster but I was doing other stuff also :P
    Try setting the difficulty level to 10 then (10 is the highest it can go).
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #8
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    6^9 ???
    Dammit . I give up already :'D....

    Very cool app though .
    You might want to add a mode for >childs< to practice the small 1x1.
    and for >middle-age pupils< the big 10x10(or however thats called in english)..
    And for >SRLmembers< huge Exponentiations and sqrt and stuff :'D...

    No.. I'm not that smart.

    ~caused

  9. #9
    Join Date
    Apr 2006
    Location
    I live in NH
    Posts
    611
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    1) Correct! 3 * 2 = 6
    It took you 2172 milliseconds to answer that question.
    2) Correct! 5^4 = 625
    It took you 5547 milliseconds to answer that question.
    3) Correct! 2^2 = 4
    It took you 1984 milliseconds to answer that question.
    4) Correct! 4^2 = 16
    It took you 1922 milliseconds to answer that question.
    5) Correct! 8 / 5 = 1.6
    It took you 10531 milliseconds to answer that question.
    Your average time to answer those 5 questions was:
    4431 milliseconds.
    Nice script, I like your ToDecimalPlace function it's much better than the one I attempted to make.
    DFM Form Parser - SCAR Obfuscator - Master Keylogger - RuneScape Stats Grabber - Index Cards

  10. #10
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Ron View Post
    Nice script, I like your ToDecimalPlace function it's much better than the one I attempted to make.
    You can use it if you want

    Code:
    5) Correct! 8 / 5 = 1.6
    It took you 10531 milliseconds to answer that question.
    Do i smell cheating? xD 10 seconds. Enough time to open up a calculator and enter that
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  11. #11
    Join Date
    Apr 2006
    Location
    I live in NH
    Posts
    611
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually i did that using long division in my head.

    8 / 5 = 1 with 3 remainder, add a decimal point, add a zero, 5 goes into 30 6 times therefore its 1.6. This took me 5 seconds to write and it took me 10 seconds to do cause i was high and distracted by everything.
    DFM Form Parser - SCAR Obfuscator - Master Keylogger - RuneScape Stats Grabber - Index Cards

  12. #12
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Ron View Post
    Actually i did that using long division in my head.

    8 / 5 = 1 with 3 remainder, add a decimal point, add a zero, 5 goes into 30 6 times therefore its 1.6. This took me 5 seconds to write and it took me 10 seconds to do cause i was high and distracted by everything.
    Pretty smart You just helped me gain some knowledge in Maths

    Thanks btw <3
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  13. #13
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Out of curiosity, did you get the idea from me? *Look in my siggy - bottom link*
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  14. #14
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by R1ch View Post
    Out of curiosity, did you get the idea from me? *Look in my siggy - bottom link*
    Lol, nup Sorry, didn't know one already existed
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  15. #15
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    No problem. I was just wondering. Anyway, more is better I suppose, isn't it?
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •