Files
Implementation
To install the visualizer, you'll have to download it to a certain directory and download and extract
the test set of images to subdirectory "images" of the same directory.
To use the visualizer, you'll have to adopt your solution to read parameters from standard in and write output
to standard out (this does not effect the way the solution you submit on the website should work).
Your program should first read the parameters
to shoulderSurfing, one per line. You should then output a sequence of lines
with a single digit: '1' on them. Each '1' that you output corresponds to a
call to successfulLogin, and after each '1' you should read 10*SZ+2 lines
corresponding to the 10*SZ+2 elements returned from successfulLogin. Finally,
you should output a '0' and then repeatedly read the parameters to
loginScreen, outputting two lines corresponding to your return from
loginScreen.
To do this, you might implement the following psuedocode:
successfulLogin(){
writeLine("1")
flush(stdout)
for(i = 0; i<10*SZ+2; i++)
ret[i] = readLine()
return ret
}
main(){
shoulderSurfing(int(readLine()),int(readLine()),int(readLine()))
writeLine("0")
flush(stdout)
while(true)
for(i = 0; i<10*SZ; i++)
screen[i] = readLine()
a = loginAttempt(screen)
writeLine(a[0])
writeLine(a[1])
flush(stdout)
}
To run the visualizer with your solution on the test with seed <num>, you should run:
java -jar GraphicalAuthentication.jar -seed <num> -exec "<cmd>"
where <cmd> is the command to execute your program.
You can use -novis option to turn off the visualization, and -delay <n> option to set the delay between
showing login attempts to <n> milliseconds.