#!/bin/env perl

# 巊梡僉儍儔堦棗
@TH10CHARS = (
	'攷楉 楈柌乮桿摫憰旛乯', 
	'攷楉 楈柌乮慜曽廤拞憰旛乯', 
	'攷楉 楈柌乮晻報憰旛乯', 
	'柖塉 杺棟嵐乮崅埿椡憰旛乯', 
	'柖塉 杺棟嵐乮娧捠憰旛乯', 
	'柖塉 杺棟嵐乮杺朄巊偄憰旛乯'
);

# 擄堈搙堦棗
@TH10LEVELS = (
	'Easy',
	'Normal',
	'Hard',
	'Lunatic'
);


# 巊梡僉儍儔梡偺SelectForm惗惉
sub makeTh10CharsSelect(){
	$buf = "<select name=\"th10char\">\n";
	$buf .= "<option value=\"\">-</option>\n";
	for(my $i=0; $i<=$#TH10CHARS; $i++){
		$buf .= "<option value=\"${i}\">${TH10CHARS[$i]}</option>\n";
	}
	$buf .= "</select>\n";
	return $buf;
}

# 擄堈搙梡偺SelectForm惗惉
sub makeTh10LevelsSelect(){
	$buf = "<select name=\"th10level\">\n";
	$buf .= "<option value=\"\">-</option>\n";
	for(my $i=0; $i<=$#TH10LEVELS; $i++){
		$buf .= "<option value=\"${i}\">${TH10LEVELS[$i]}</option>\n";
	}
	$buf .= "</select>\n";
	return $buf;
}

# id偐傜巊梡僉儍儔偺昞帵暥帤楍庢摼
sub getTh10CharValue(){
	my ($val) = @_;
	if($val ge "0" and $val le "$#TH10CHARS"){
		return $TH10CHARS[$val];
	}
	else{
		return "";
	}
}

# id偐傜擄堈搙偺昞帵暥帤楍庢摼
sub getTh10LevelValue(){
	my ($val) = @_;
	if($val ge "0" and $val le "$#TH10LEVELS"){
		return $TH10LEVELS[$val];
	}
	else{
		return "";
	}
}

1;
