use strict;
use locale;

my %images = (
'AGS tutoring' => 'http://www.bigbluecup.com/images/tutoring.gif',
'play-testing' => 'http://www.bigbluecup.com/images/playtesting.gif',
'voice acting' => 'http://www.bigbluecup.com/images/speech.gif',
'music' => 'http://www.bigbluecup.com/images/music.gif',
'backgrounds' => 'http://www.bigbluecup.com/images/backgrounds.gif',
'character art' => 'http://www.bigbluecup.com/images/characters.gif',
'animation' => 'http://www.bigbluecup.com/images/animation.gif',
'proof reading' => 'http://www.bigbluecup.com/images/proof.gif',
'scripting' => 'http://www.bigbluecup.com/images/coding.gif',
'story design' => 'http://www.bigbluecup.com/images/design.gif',
'web design' => 'http://www.bigbluecup.com/images/web.gif',
'translating' => 'http://www.bigbluecup.com/images/translate.gif'
);

print $images{'music'}."\n";

my %users = ();
open in, "users_with_skills.txt";
while(<in>){
	chomp;
	my ($id, $name, @skills) = split(/\t/);
	my ($tutoring, $testing, $voice, $music, $background, $character, $animation, $proof, $scripting, $story, $web, $translate);
	for(@skills){
		$tutoring = $1 if(/^AGS tutoring:* (.+)$/i);
		$testing = $1 if(/^play-testing:* (.+)$/i);
		$voice = $1 if(/^voice acting:* (.+)$/i);
		$music = $1 if(/^music:* (.+)$/i);
		$background = $1 if(/^backgrounds:* (.+)$/i);
		$character = $1 if(/^character art:* (.+)$/i);
		$animation = $1 if(/^animation:* (.+)$/i);
		$proof = $1 if(/^proof reading:* (.+)$/i);
		$scripting = $1 if(/^scripting:* (.+)$/i);
		$story = $1 if(/^story design:* (.+)$/i);
		$web = $1 if(/^web design:* (.+)$/i);
		$translate = $1 if(/^translating:* (.+)$/i);
	}
	$users{$id} = {
		'name' => $name,
		'AGS tutoring' => $tutoring,
		'play-testing' => $testing,
		'voice acting' => $voice,
		'music' => $music,
		'backgrounds' => $background,
		'character art' => $character,
		'animation' => $animation,
		'proof reading' => $proof,
		'scripting' => $scripting,
		'story design' => $story,
		'web design' => $web,
		'translating' => $translate
	};
}
close in;

my $keyword = shift(@ARGV);

for(keys %users){
	my $id = $_;
	if($users{$id}{$keyword}){
		print "$id\t".$users{$id}{'name'}."\n\t".$users{$id}{$keyword}."\n";
	}
}