Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: raffling the Sparc
- To: tlug@example.com
- Subject: tlug: raffling the Sparc
- From: Jim Schweizer <schweiz@example.com>
- Date: Fri, 21 Nov 1997 23:20:13 +0900 (JST)
- Content-Transfer-Encoding: 8bit
- Content-Type: text/plain; charset=us-ascii
- Organization: JPS Solutions
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Hi all, Craig's question about using a random number for raffling off the door prizes has been a real motivator for me to learn more about perl. Thanks to Jim T. and his help, I spent some more time on this and came up with a more 'perlesque' solution. There are two drawbacks to this script - someone has to enter the names into the @example.com array when they buy a raffle ticket, and I don't (yet) know how to break the loop when @example.com is empty. As always, I appreciate the feedback from all of you. rand.pl for raffling off the Sparcs: -------cut here--------------------------- #!/usr/bin/perl -w use strict srand( time() ^ ($$ + ($$ << 15)) ); # get the names of TLUGers present @example.com = ("Craig", "Steve", "Casmar", "Damien", "Jim T.", "Blaine", "Jason", "Joe", "John",); print "\nLet's get started.\n@example.com have all bought tickets.\n\n"; while () { print "Shall we pick a name? "; chop ($more = <STDIN>); if ($more eq "yes") { #get a winner from @example.com $win = rand(@example.com); #print the random winner print "\nGive $cooldudes[$win] a Sparc.\n"; splice(@example.com, $win, 1); print "The losers were @example.com"; } else{ exit; }} --------------cut------------------------------- I know there's a lot more that could be done with a script like this.... (but, hey, not bad for a simple country English teacher;-) Thanks, Jim S. ---------------------------------- Jim Schweizer <schweiz@example.com> sent this on 21-Nov-97 at 23:20:13 It is much easier to suggest solutions when you know nothing about the problem. http://www1.harenet.or.jp/~schweiz/ ---------------------------------- --------------------------------------------------------------- TLUG Meeting Dec. 13, 12:30 at Tokyo station Yaesu Chuo ticket gate 13:30 Starbuck's coffee. 13:45 HSBC | info: joem@example.com At least 3 functional Sparc IPC machines will be raffled out --------------------------------------------------------------- a word from the sponsor: TWICS - Japan's First Public-Access Internet System www.twics.com info@example.com Tel:03-3351-5977 Fax:03-3353-6096
- Follow-Ups:
- Re: tlug: raffling the Sparc
- From: Oliver R Oberdorf <oly@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: TLUG and Cal LUG? [was Re: tlug: gcc bug in SlackWare 3.3]
- Next by Date: Re: tlug: raffling the Sparc
- Prev by thread: Re: tlug: gcc bug in SlackWare 3.3
- Next by thread: Re: tlug: raffling the Sparc
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links