Friday, August 12, 2005

Practice Script Improvements

I have added a few features to the perl script I posted a few posts back. Here they are:

1. An additional array for your favorite darts. So I know that most folks have a lessened affinity for switching between multiple dart sets between games, and most people in fact stick to a single set or two. Thus I have added an array in which you can list these few (or one) sets called @priority_sets and provided a way to call it with a switch. Simply include an 'f' anywhere on the command line after the name of the program. 'f' stands for 'favorite darts'. Example: $practice.pl f

2. Args act like switches. Instead of now having to have a number followed by a space followed by the 'f', you can specify the number of games and put your 'f' in any order and spaces do not matter. So these are all equivalent:

practice.pl 10 f
practice.pl 10f
practice.pl fav10
practice.pl f 10

3. Doubles array. I added an array to be picked from randomly that holds different ways of practicing your doubles. Clockwise, counter-clockwise, up, down, etc. This of course is only called when doubles is selected as the game to play.

Note on arrays: the arrays in this prog are written with one element on each line on purpose. This way you can comment out dart sets that have fallen from grace or which you wanna set aside for what ever reason. Notice in the pic to the righ I have commented out two of the fav sets so that when I use the 'f' switch I always end up throwing with the Bombs.

Alias for "quickie" and "practice" modes: Add this line to your profile (on a Mac: /etc/profile) so that you can just type 'quickie' at any prompt without having to worry about what the pwd is. As you can see form the pic below you can use the f switch with these as well:

alias quickie='/Users/robert/projects/random/practice.pl'
alias practice='/Users/robert/projects/random/practice.pl 10'

No comments: