time and input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark farid
    New Member
    • Jan 2012
    • 1

    time and input

    I am trying to write a really basic program based on a trivia game. i have two problems. the first, is that i do not know how to assign a variable whose value will increase with time. my second problem is that i need to allow the user to enter an input before time runs out. the problem is that: suppose i successfully start a stopwatch once the question is asked(and assign the stopwatch value to a variable). if i write 'if stopwatchTime < maxTimeAllowed: userAns = input()' the statement will be true, and the program will take an input. but, after i call the input function, the rest of the program suspends until an input is given. i need a way for the program to be simultaneously waiting for an input AND checking to see if the time limit has passed, so that after a certain amount of time, the program will not accept an input from the user.
  • Jory R Ferrell
    New Member
    • Jul 2011
    • 62

    #2
    See the following:



    If you need any more help message Bvdet.

    Comment

    • Jory R Ferrell
      New Member
      • Jul 2011
      • 62

      #3
      :P The credit actually goes to Bvdet since she/he is the one who solved it.

      Comment

      Working...