Advertisement
Dmi7ry

scr_Check

Mar 7th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OldWordA = false;                           // Setting up answer variable
  2. global.OldWordQ = "";
  3. repeat 3                                    // Run loop while answer is wrong and it has been repeated less than 3 times
  4. {
  5.     global.OldWordQ = get_string("What word was replaced?", "");        // Getting user input with question and no prompt
  6.    
  7.     if string_lower(global.OldWordQ) == string_lower(global.DelWord)    // Checking that input equals deleted word (string_lower stops capitalisation effects the result
  8.     {
  9.         OldWordA = true;                    // Setting correct answer variable to true to stop the loop and to allow it to be checked later
  10.         break;
  11.     }
  12. }
  13.    
  14. NewWordA = false;
  15. globalvar NewWordA;
  16. repeat 3
  17. {
  18.     global.NewWordQ = get_string("What word is new?", "");
  19.     if string_lower(global.NewWordQ) == string_lower(global.WildCard)
  20.     {
  21.         NewWordA = true;
  22.         break;
  23.     }
  24. }
  25.    
  26. if NewWordA and OldWordA                    // Checking if both questions are correct
  27.     global.Win = true;                      // Setting win variable to true if questions are right
  28. else
  29.     global.Win = false;                     // If either/both are wrong then set win to false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement