Received: from dns.netbusiness.it (dns.netbusiness.it [194.184.167.2]) by pisoft.it (8.8.5/8.8.5) with ESMTP id UAA09501 for ; Mon, 1 Feb 1999 20:06:22 +0100 Received: from fastidio.manzonet (IDENT:postfix@m-bovolone29.netbusiness.it [195.120.222.158]) by dns.netbusiness.it (8.9.2/8.9.2) with ESMTP id UAA14902 for ; Mon, 1 Feb 1999 20:06:17 +0100 (MET) Received: by fastidio.manzonet (Postfix, from userid 500) id 791159A67; Sun, 31 Jan 1999 14:56:28 +0100 (CET) Message-ID: <19990131145628.B640@fastidio.manzonet> Date: Sun, 31 Jan 1999 14:56:28 +0100 From: Andrea Manzini To: andreoli@pisoft.it Subject: piccolo giochino Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.93.2 X-UIDL: 581157e4dc43344a0d1882443279562f Status: RO X-Status: A Content-Length: 1722 Lines: 71 Ciao Michele, Avevo 5 minuti liberi ed ho scritto questo piccolo rompicapo per mulinux, non è 'sto gran che ma spero ti piaccia :) P.S. Hai per caso cambiato qualcosa nella formattazione dei dischi nella 3.2 ? Ho provato 15 floppy *nuovi* ma non me ne funziona manco uno :( Il floppy viene formattato e scritto correttamente ma al boot da' crc error e si pianta... %%cut%% #!/bin/ash set -- `cat /proc/uptime` C=`expr $1 % 5` case $C in 0) S="9 5 6 3 2 4 8 7 1" ;; 1) S="8 6 5 7 4 2 9 1 3" ;; 2) S="7 2 8 1 9 3 5 6 4" ;; 3) S="1 6 2 4 8 3 9 7 5" ;; *) S="5 8 1 6 4 2 3 9 7" ;; esac M=1 doinvert() { N="$1" set -- `echo "$S"` case $N in 2) S="$2 $1 $3 $4 $5 $6 $7 $8 $9" ;; 3) S="$3 $2 $1 $4 $5 $6 $7 $8 $9" ;; 4) S="$4 $3 $2 $1 $5 $6 $7 $8 $9" ;; 5) S="$5 $4 $3 $2 $1 $6 $7 $8 $9" ;; 6) S="$6 $5 $4 $3 $2 $1 $7 $8 $9" ;; 7) S="$7 $6 $5 $4 $3 $2 $1 $8 $9" ;; 8) S="$8 $7 $6 $5 $4 $3 $2 $1 $9" ;; 9) S="$9 $8 $7 $6 $5 $4 $3 $2 $1" ;; esac } cat << END Welcome to --> R E V E R S E ----------------- E S R E V E R <-- You must reorder a 9 digit string from 1 to 9. You may pick any of the individual digits in your string to invert. Then all of the numbers from the leftmost position, through the one you pick, will be reversed in their order of presentation. Enter q to quit. END while [ 1 ] ; do if [ "$S" = "1 2 3 4 5 6 7 8 9" ] ; then echo "YOU DID IT !! CONGRATULATIONS!" exit fi echo "Move #$M -- Your string is --> $S <--" echo -n "How many digits to invert ? " read C case $C in 1|2|3|4|5|6|7|8|9) doinvert $C ; M=`expr $M + 1`;; q) exit esac done %%cut%% -- Andrea Manzini | "Tristo è quel discepolo che non supera il linux@netbusiness.it | suo maestro" (Leonardo da Vinci, 1452-1519)