The program will has 5 different levels of difficulties which correspond to a number of seconds the use has to enter an answer. how i do that with tic toc function?
X=floor(10*rand(1));Y=floor(10*rand(1));format shortformatSpec='Vad blir: %2f x %4f \n' ;ticfprintf(formatSpec,X,Y)riktigt_svar=X*Y;Ditt_Svar=input('Svar:');t=tocpause(0.5);if Ditt_Svar == riktigt_svar msgbox('Right answer')else if Ditt_Svar ~= riktigt_svar errordlg(['Right answer is',num2str(riktigt_svar)],'Error') end end
Best Answer