#! /usr/bin/perl -w # Copyright (C) 2003 Stephane Levant # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # Résolution de pendu # Voir le man ou l'option --help pour la documentation. # v 0.1 : # for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; # do echo -n "$i: "; dico 'T??t' 2>/dev/null | cut -c 3-7 | grep -i $i | wc -l; # done | sort -n +1 use strict; my $VERSION=0.21; use Pod::Usage; use Getopt::Long; # The program name my $prog = $0; $prog =~ s:/.+/::; # Options my ($version,$man,$help,$word); sub version { print "$prog $VERSION This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "; exit 0; } # Treat options Getopt::Long::Configure ("bundling"); GetOptions ( 'version|v' => \$version, 'man|m' => \$man, 'help|h|?' => \$help, 'word|w' => \$word, ) || pod2usage(2); pod2usage(1) if $help; pod2usage(-verbose => 2) if $man; version if ($version); my $patern = $ARGV[0]; my $exclude = "#"; if (@ARGV == 2) { $exclude = $ARGV[1]; } my $alphabet = "abcdefghijklmonpqrstuvwxyz"; my %t; my @sol; my $idx = 1; sub removeknown { my ($txt) = @_; my $result = ""; for (my $i=0; $i/dev/null`) { if (/^\t(.*)/) { my $txt = $1; $txt =~ tr/àáâãäåçèéêëìíîïðñòóôõöøùúûüýÿ/aaaaaaceeeeiiiionoooooouuuuyy/; $txt=removeknown($txt); my $print = 0; for (my $i=0; $i [-w] 'I' [I] =head1 DESCRIPTION solpendu utilise le programme dico, disponible ici : http://public.www.planetmirror.com/pub/hpfreeware/Text/dico-1.1/ I est le mot à chercher. Les lettres non encores trouvé sont symbolisées par des point d'interrogation. I est la liste des lettres déjà proposées. =head1 OPTIONS =over 8 =item B<-w>, B<--word> Affiche directement tous les mots possibles. =back =head1 OPTIONS STANDARD GNU =over 8 =item B<--help> Afficher un message d'aide sur la sortie standard, et se terminer normalement. =item B<--version> Afficher un numéro de version sur la sortie standard, et se terminer normalement. =item B<--> Terminer la liste des options. =back =head1 AUTRES OPTIONS =over 8 =item B<-m>, B<--man> Affiche cette page et quitte. =back =head1 EXEMPLES B 'A???E' B 'A???C?T' es =head1 VOIR AUSSI L http://public.www.planetmirror.com/pub/hpfreeware/Text/dico-1.1/ =head1 AUTEUR Stephane Levant Esun@tuxfamily.orgE =cut }