<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import bluetooth

correctAnswers1 = 0
incorrectAnswers1 = 0
correctAnswers2 = 0
incorrectAnswers2 = 0

#find device
print("performing inquiry...")

nearby_devices = bluetooth.discover_devices()

print("found %d devices" % len(nearby_devices))

for addr, name in nearby_devices:
	print("  %s - %s" % (addr, name))

#while bluetooth.server_sock() = open:
#	open bluetooth.service_(server_cock "Mindwave")
#	server_sock.recv(1024)
#	print "recieved [s%]" "wave"

#timer
timeit.default_timer()

#math problems
def mathProblems():
	print 'The levels of difficulty are as follows: \n 1 - Addition \n 2 - Multiplication'
	difficulty = input('Please select a difficulty by inputing a number')

	if dificulty == 1:
    	userAnswers = input('What is the value of 1 + 1')
    	if userAnswers == 2:
        	print 'correct'
        	global correctAnswers1
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	global incorrectAnswers1
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
   	 
    	userAnswersA1 = input('What is the value of 34 + 56')
    	if userAnswersA1 == 90:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA2 = input('What is the value of 96 + 52')
    	if userAnswersA2 == 148:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
       	 
    	userAnswersA3 = input('What is the value of 916 + 522')
    	if userAnswersA3 == 1438:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA4= input('What is the value of 196 + 152')
    	if userAnswersA4 == 348:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA5 = input('What is the value of 9102 + 52')
    	if userAnswersA5 == 9154:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
       	 
    	userAnswersA6 = input('What is the value of 73 + 498')
    	if userAnswersA6 == 571:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA7 = input('What is the value of 731 + 1498')
    	if userAnswersA6 == 2229:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA8 = input('What is the value of 58911 + 14261')
    	if userAnswersA8 == 73172:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA9 = input('What is the value of 48932 + 146459')
    	if userAnswersA9 == 195391:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

    	userAnswersA10 = input('What is the value of 932123 + 16129')
    	if userAnswersA10 == 948252:
        	print 'correct'
        	correctAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers1 += 1
        	print 'So far you have answered', correctAnswer1, 'questions correct'

#    	averageHertz = (bluetooth.Mindwave(int 1) * (correctAnswers1 / timeElapsed))
#    	return averageHertz


	if dificulty == 2:
    	userAnswers = input('What is the value of 1 X 1')
    	if userAnswers == 1:
        	print 'correct'
        	global correctAnswers2
        	correctAnswers2 += 1
    	else:
        	print 'incorrect'
        	global incorrectAnswers2
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers1 = input('What is the value of 4 X 5')
    	if userAnswers1 == 20:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers2 = input('What is the value of 14 X 6')
    	if userAnswers2 == 84:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers3 = input('What is the value of 14 X 6')
    	if userAnswers3 == 84:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'       	 

    	userAnswers4 = input('What is the value of 31 X 6')
    	if userAnswers4 == 186:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers5 = input('What is the value of 21 X 61')
    	if userAnswers5 == 1281:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'  	 

    	userAnswers6 = input('What is the value of 4 X 523')
    	if userAnswers6 == 2092:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'                  	 

    	userAnswers7 = input('What is the value of 41 X 223')
    	if userAnswers7 == 9143:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers8 = input('What is the value of 141 X 298')
    	if userAnswers8 == 42018:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

    	userAnswers9 = input('What is the value of 1238 X 8463')
    	if userAnswers9 == 10477194:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'


    	userAnswers10 = input('What is the value of 11411 X 29620')
    	if userAnswers10 == 337993820:
        	print 'correct'
        	correctAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'
    	else:
        	print 'incorrect'
        	incorrectAnswers2 += 1
        	print 'So far you have answered', correctAnswer2, 'questions correct'

#    	averageHertz = (bluetooth.Mindwave(int 1) * (correctAnswers1 / timeElapsed))
#   	return averageHertz

print averageHertz


</pre></body></html>