From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 29 02:30:03 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C6A716A41C for ; Sun, 29 May 2005 02:30:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA9FB43D1D for ; Sun, 29 May 2005 02:30:02 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4T2U2Ac021159 for ; Sun, 29 May 2005 02:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4T2U2HT021157; Sun, 29 May 2005 02:30:02 GMT (envelope-from gnats) Resent-Date: Sun, 29 May 2005 02:30:02 GMT Resent-Message-Id: <200505290230.j4T2U2HT021157@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Aaron Dalton Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E3C916A41C for ; Sun, 29 May 2005 02:19:59 +0000 (GMT) (envelope-from aaron@mail.finch.st) Received: from mpls-qmqp-01.inet.qwest.net (mpls-qmqp-01.inet.qwest.net [63.231.195.112]) by mx1.FreeBSD.org (Postfix) with SMTP id 4E38143D49 for ; Sun, 29 May 2005 02:19:58 +0000 (GMT) (envelope-from aaron@mail.finch.st) Received: (qmail 67535 invoked by uid 0); 29 May 2005 02:19:58 -0000 Received: from unknown (63.231.195.6) by mpls-qmqp-01.inet.qwest.net with QMQP; 29 May 2005 02:19:58 -0000 Received: from finch.st (HELO mail.finch.st) (168.103.194.212) by mpls-pop-06.inet.qwest.net with SMTP; 29 May 2005 02:19:57 -0000 Received: from aaron by mail.finch.st with local (Exim 4.51 (FreeBSD)) id 1DcDFr-000BKR-Pl for FreeBSD-gnats-submit@freebsd.org; Sat, 28 May 2005 20:10:19 -0600 Message-Id: Date: Sat, 28 May 2005 20:10:19 -0600 From: "Aaron Dalton" Sender: "Aaron Dalton" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/81612: New Port: games/p5-Games-Dice X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Aaron Dalton List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2005 02:30:03 -0000 >Number: 81612 >Category: ports >Synopsis: New Port: games/p5-Games-Dice >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 29 02:30:01 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Aaron Dalton >Release: FreeBSD 5.2.1-RELEASE i386 >Organization: >Environment: System: FreeBSD chariss.finch.st 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #1: Sat Mar 5 16:29:20 MST 2005 ross@chariss.finch.st:/usr/src/sys/i386/compile/CHARISS i386 >Description: Games::Dice simulates die rolls. It uses a function-oriented (not object-oriented) interface. No functions are exported by default. At present, there are two functions which are exportable: roll and roll_array. The latter is used internally by roll, but can also be exported by itself. The number and type of dice to roll is given in a style which should be familiar to players of popular role-playing games: adb[+-*/b]c. a is optional and defaults to 1; it gives the number of dice to roll. b indicates the number of sides to each die; the most common, cube-shaped die is thus a d6. % can be used instead of 100 for b; hence, rolling 2d% and 2d100 is equivalent. roll simulates a rolls of b-sided dice and adds together the results. The optional end, consisting of one of +-*/b and a number c, can modify the sum of the individual dice. +-*/ are similar in that they take the sum of the rolls and add or subtract c, or multiply or divide the sum by c. (x can also be used instead of *.) Hence, 1d6+2 gives a number in the range 3..8, and 2d4*10 gives a number in the range 20..80. (Using / truncates the result to an int after dividing.) Using b in this slot is a little different: it's short for "best" and indicates "roll a number of dice, but add together only the best few". For example, 5d6b3 rolls five six- sided dice and adds together the three best rolls. This is sometimes used, for example, in roll-playing to give higher averages. Generally, roll probably provides the nicer interface, since it does the adding up itself. However, in some situations one may wish to process the individual rolls (for example, I am told that in the game Feng Shui, the number of dice to be rolled cannot be determined in advance but depends on whether any 6's were rolled); in such a case, one can use roll_array to return an array of values, which can then be examined or processed in an application-dependent manner. This having been said, comments and additions (especially if accompanied by code!) to Games::Dice are welcome. So, using the above example, if anyone wishes to contribute a function along the lines of roll_feng_shui to become part of Games::Dice (or to support any other style of die rolling), you can contribute it to the author's address, listed below. >How-To-Repeat: >Fix: --- submission.txt begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # p5-Games-Dice # p5-Games-Dice/Makefile # p5-Games-Dice/distinfo # p5-Games-Dice/pkg-descr # p5-Games-Dice/pkg-plist # echo c - p5-Games-Dice mkdir -p p5-Games-Dice > /dev/null 2>&1 echo x - p5-Games-Dice/Makefile sed 's/^X//' >p5-Games-Dice/Makefile << 'END-of-p5-Games-Dice/Makefile' X# New ports collection makefile for: Games-Dice X# Date created: 28 May 2005 X# Whom: Aaron Dalton X# X# $FreeBSD$ X# X XPORTNAME= Games-Dice XPORTVERSION= 0.02 XCATEGORIES= games perl5 XMASTER_SITES= ${MASTER_SITE_PERL_CPAN} XMASTER_SITE_SUBDIR= Games XPKGNAMEPREFIX= p5- X XMAINTAINER= aaron@daltons.ca XCOMMENT= Perl module to simulate die rolls X XMAN3= Games::Dice.3 X XPERL_CONFIGURE= yes X X.include END-of-p5-Games-Dice/Makefile echo x - p5-Games-Dice/distinfo sed 's/^X//' >p5-Games-Dice/distinfo << 'END-of-p5-Games-Dice/distinfo' XMD5 (Games-Dice-0.02.tar.gz) = 69585be0bdf4875a0c80d046f22a3ab0 XSIZE (Games-Dice-0.02.tar.gz) = 3884 END-of-p5-Games-Dice/distinfo echo x - p5-Games-Dice/pkg-descr sed 's/^X//' >p5-Games-Dice/pkg-descr << 'END-of-p5-Games-Dice/pkg-descr' XGames::Dice simulates die rolls. It uses a function-oriented (not Xobject-oriented) interface. No functions are exported by default. X XThe number and type of dice to roll is given in a style which should be Xfamiliar to players of popular role-playing games: adb[+-*/b]c. a is Xoptional and defaults to 1; it gives the number of dice to roll. b Xindicates the number of sides to each die. % can be used instead of 100 Xfor b; hence, rolling 2d% and 2d100 is equivalent. roll simulates a rolls Xof b-sided dice and adds together the results. The optional end, Xconsisting of one of +-*/b and a number c, can modify the sum of the Xindividual dice. +-*/ are similar in that they take the sum of the rolls Xand add or subtract c, or multiply or divide the sum by c. (x can also be Xused instead of *.) Using b in this slot is a little different: it's short Xfor "best" and indicates "roll a number of dice, but add together only the Xbest few". For example, 5d6b3 rolls five six- sided dice and adds together Xthe three best rolls. X XAuthor: Philip Newton XWWW: http://search.cpan.org/dist/Games-Dice/ X X- Aaron Dalton Xaaron@daltons.ca END-of-p5-Games-Dice/pkg-descr echo x - p5-Games-Dice/pkg-plist sed 's/^X//' >p5-Games-Dice/pkg-plist << 'END-of-p5-Games-Dice/pkg-plist' X%%SITE_PERL%%/Games/Dice.pm X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Games/Dice/.packlist X@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Games/Dice X@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Games 2>/dev/null || true X@unexec rmdir %D/%%SITE_PERL%%/Games 2>/dev/null || true X END-of-p5-Games-Dice/pkg-plist exit --- submission.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: