#!/usr/local/bin/perl
##----製作者----##
#
# toto-checker Version 1.00
#
# This is Freeware.
# Script written by Masayoshi
# Created on: 2002.04.13
# Update: 2002.09.03
# Copyright (C) 2002 Masayoshi. All Rights Reserved.
# I can be reached at: masayosi@mahoroba.ne.jp
# Scripts Found at: http://www3.mahoroba.ne.jp/~masayosi/jfl/top.shtml
#
############################################################
require 'cgi-lib.pl';
&ReadParse(in);
##----設定----##
# タイトル
$title = "toto-checker";
# 記録ファイル
$dat = "toto.dat";
# Home Page URL
$home = "../jfl/index.html";
# 色設定
$bgcolor = "#FFCC00";
$text = "#000000";
$link = "#CC6600";
$vlink = "#990000";
$alink = "#FF3300";
$hlink = "#FF0000";
##----設定終了----##
$in{'number'} =~ s/</g;
$in{'number'} =~ s/>/>/g;
print "Content-type: text/html\n\n";
print "\n";
print "\n";
print "
\n";
print "\n";
print "$title\n";
print "\n";
print "\n";
print "\n\n";
##----分岐----##
if($in{'number'} eq ""){
&display;
}
if($in{'number'} =~ /[^0-9]/){
$result = "開催回を半角英数字で入力してください";
&display;
exit;
}
##----確認----##
open (FILE, "$dat");
@allbody = ;
close(FILE);
foreach $line (@allbody){
chomp $line;
if($line =~ /$in{'number'}/){
($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $n) = split(/:/,$line);
$position = 0;
$hit = 0;
while( ($position = index($line, x, $position))>0){
$hit ++;
$position ++;
}
if($in{'r1'} =~ /$b/){
$hit += 1;
}
if($in{'r2'} =~ /$c/){
$hit += 1;
}
if($in{'r3'} =~ /$d/){
$hit += 1;
}
if($in{'r4'} =~ /$e/){
$hit += 1;
}
if($in{'r5'} =~ /$f/){
$hit += 1;
}
if($in{'r6'} =~ /$g/){
$hit += 1;
}
if($in{'r7'} =~ /$h/){
$hit += 1;
}
if($in{'r8'} =~ /$i/){
$hit += 1;
}
if($in{'r9'} =~ /$j/){
$hit += 1;
}
if($in{'r10'} =~ /$k/){
$hit += 1;
}
if($in{'r11'} =~ /$l/){
$hit += 1;
}
if($in{'r12'} =~ /$m/){
$hit += 1;
}
if($in{'r13'} =~ /$n/){
$hit += 1;
}
if($hit <= 10){
$result = "Lost";
}
elsif($hit == 11){
$result = "3等";
}
elsif($hit == 12){
$result = "2等";
}
elsif($hit == 13){
$result = "1等";
}
&display;
exit;
}
}
##----表示----##
sub display{
print "\n\n";
print "戻る
\n";
print "toto-checker Ver.1.00
\n";
print "\n";
print "\n";
exit;
}