! PRINCESS MASK EXPERIMENT ! This program presents 32 .jpg images plus a mask image saved in the same folder !The name of the images should be "blur-" followed by a number ranging from 1 to 32, followed by ".jpg" ! Images from 1 to 8 the Princess doesn't have any mask ! Images from 9 to 16 the Princess has "mouth" masked ! Images from 17 to 24 the Princess has the "eye" masked ! Images from 25 to 32 the Princess has the both the "mouth" and the "eye" masked PUBLIC name$ CALL myopenfile (#1) DIM vettrand(1) LET nimages = 32 LET waitprincess = 2 MAT REDIM vettrand(nimages) CLEAR ASK PIXELS px,py SET WINDOW 1,px,1,py LET cx=int(px/2) LET cy=int(py/2) CALL urn (nimages,vettrand(),nimages) SET BACK "black" SET COLOR "white" PRINT "YOU ARE REQUIRED TO INSPECT AN IMAGE THAT MIGHT BE BLURRED." PRINT "PLEASE RATE THE LEVEL OF RESPONSIVENESS WITH A NUMBER RANGING FROM 1 (NO CONTENT) TO 7 (VERY MUCH CONTENT)" PRINT "PRESS ANY KEY TO START" GET KEY AAAA CLEAR FOR i = 1 to nimages LET im$ = "blur-" & str$(vettrand(i))& ".jpg" CALL Read_Image("JPEG",imagedata$,im$) BOX SHOW imagedata$ at 350,0 LET answer = 0 DO GET KEY answer LOOP until answer>48 and answer <56 LET masked$ = "NOMASK" LET ans = vettrand(i) IF vettrand(i)>8 and vettrand(i) < 17 then LET masked$ = "MOUTH" LET ans= vettrand(i)-8 END IF IF vettrand(i)>16 and vettrand(i) < 25 then LET masked$ = "EYES" LET ans= vettrand(i)-16 END IF IF vettrand(i)>24 then LET masked$ = "BOTH" LET ans= vettrand(i)-24 END IF CLEAR CALL savedata(#1,str$(ans),masked$, chr$(answer)) CALL Read_Image("JPEG",mask$,"mask.jpg") BOX SHOW mask$ at 10,0 PAUSE waitprincess CLEAR NEXT i CLOSE #1 PRINT "THANK YOU, END OF THE EXPERIMENT" END !##################################################################### SUB savedata (#1,cond$, p$, ans$) PRINT#1: cond$,p$, ans$ END SUB !##################################################################### SUB myopenfile(#1) DECLARE PUBLIC name$ INPUT prompt "Please, write your initials and press enter ":name$ CLEAR OPEN#1:name name$&"-MASK.txt",org text,create newold RESET#1:end SET #1 : MARGIN 150 SET #1 : ZONEWIDTH 22 PRINT#1:"BLUR LEVEL","PICTURE","ANSWER" END SUB !************************************************************* SUB urn(k, pp(),n) DIM qq(1) MAT redim qq(n) RANDOMIZE FOR i= 1 to n LET qq(i)= i NEXT i FOR i= 1 to k LET kk= int(rnd*(n-i+1))+1 LET pp(i)= qq(kk) LET qq(kk)= qq(n+1-i) NEXT i END SUB