#!/usr/bin/perl use term; $SIG{INT}='IGNORE'; $seed=substr(rand(1)*10,0,1); $seed+=1; print "Guess the Code:"; $st=time(); $ip=<>; chop($ip); while($seed != $ip) { $seed=substr(rand(1)*10,0,1); $seed++; $ip=<>; } if($seed == $ip) { $et=time(); $tt=$et-$st; print "\n Time Taken 2 break the Code ..:",$tt," Seconds\n"; }