sub GetQuestion { $PointValue = $ScoreValues[rand($#ScoreValues)]; if (rand(15) == 0) { $PointValue *= 2; } $FileNum = int(rand($TotalFiles))+1; $QNum = int(rand($QuestionDBinfo{$FileNum}[1]))+1; open(QFILE, $QuestionDBinfo{$FileNum}[0]) or die "Error opening the trivia file\n"; for($i = 0; $i < $QNum; $i += 1) { $QuestionLine = ; } close(QFILE); $d = substr($QuestionLine,0,1); $Question = (split(/[$d][$d]/,$QuestionLine))[1]; $Category = (split(/[$d]/,$QuestionLine))[1]; $Answer = (split(/[$d]/,$QuestionLine))[2]; $QID = "F".$FileNum.".Q".$QNum; chomp($Question); if ($Category eq "Scramble") { @letters = (); for($i=0;$i= 0) { if (int(rand(2)) == 1) { $PointValue *= 2; } $l -= 3; } } @retval = ($PointValue, $QID, $Category, $Question, $Answer); return @retval; }