With apologies to The Bard and The Scottish Play for the bad miss-quote above. I am continuing on with my D&D Moose Quest. The last post I left of with what to do now that I am going to try to use a number of Mixins and how they perhaps can work with other classes.
I have chosen the 'OpenDoorsOnA' character ability as it is one that is not only effected by 'Strength' it can also be effected by The 'Fighter Class' as they get an extra roll of % dice to extend there strength from 01 to 100 (00 in D&D speak) but still staying below 19. To account for this I could just fix my 'OpenDoorsOnA' role a little to look for the exceptional strength attribute like this
Imagine you open up a test file and you see the following:
is foobar(3), 17, 'foobar(3) should return 17';
is foobar(2), 15, 'foobar(2) should return 15';
is foobar(3), 17, 'foobar(3) should return 17'; # duplicate?
is foobar(4), 20, 'foobar(4) should return 20';
is foobar(3), 17, 'foobar(3) should return 17'; # duplicate?
Well, that looks strange and duplicated tests are a code smell. However, it could be a code smell in one of two ways. It's probably the case that some programmer got sloppy and duplicated the tests so do you delete the extra tests?
The section on reserved names in GCC documentation gives several recommendations that probably the vast majority of C programs in the world do not follow.
Nevertheless, these are all good practices, and an interesting exercice was to check how the latest stable perl source code behaves v.s. these recommendations. As of the day writing this blog entry, this is perl-5.18.1.
Detailed list of "violations" is at this gist, generated on linux and gcc version 4.8.2 (Debian 4.8.2-10). It is interesting to note that over 1316 hits, there are 8 categories, with 4 of them eating 98% of the hits:
In my last D&D post I left off with my six abilities as attributes in my character class and two 'traits/roles', ('Languages' and 'Henchmen') it did leave me with the question. Should I treat all or just some these character abilities as 'trait/roles' or should some be subs in my base class or $flip back and make my base abilities roles or even to go back to square one again and just make them subs in my original base class??
So I did a little reading and thinking and personally all these little code snippets do make my base class a little less cluttered which is nice but doesn't give me much. So I was wondering if I could reuse any of them and perhaps benefit from code reuse.
Hello world and Happy Holidays!! This is my first time blogging in blogs.perl.org and I figure I take this opportunity to ask the Perl community for suggestions on how I can make this Perl code run faster.
As the name of the script implies, I want to parse a cpan autobundle file so I can generate a list of distribution files from which I can create a Pinto repository. Please note that the script is incomplete and I am just wondering if there is a better approach to generate a list of distribution files.
A sample of an autobundle file can be found in the link below:
Hello, I'd like to post a link to the "table_watch_SQLite.pl" script. It's not a link in the strict sense because I couldn't manage to set a MetaCPAN perma-link to a single file.
The script is located in the "example" directory of the Term::Choose distro.
With "table_watch_SQLite.pl" one can search and read in Databases.
I use it for SQLite Databases but it should work with MySQL and PostgreSQL Databases too.
Well it seems I am making a little progress with D&D 'Character' classes I think I even got a role that will stick. I did have a little unfinished business from my previous post with my 'Character' class that I have to fix.
Namely it is important to the game that I know the current value of an ability which may change, and the initial value which will not, but I do not want to add in all sorts of attributes with funny odd names. So putting on my game design/players hat for a second, the initial ability values (rolls) are use mostly at character creation, for race and class selection. After that they are only useful as tombstone data.
An example is if a character is enchanted somehow or is just getting old and looses some 'Constitution' her 'Resurrection Survival' throw will lower but the maximum number of times a 'Character' can be resurrected is the initial 'Constitution' so I need that as well.
Well that is the way I feel today, but at least, like Marvin, I am ready to start again. I tried in my last post to introduce a role into my D&D classes and all I ended up with what is what I started with, a muddle!
Well having another look at 'Intelligence', 'Characters' and 'Languages' I know that all 'Characters' have at least one language and they can learn more, the more 'intelligence' they have. So language ability is more of a trait of 'intelligence', rather than a role that intelligence fulfills. Hold on a 'trait' in Moose is just a role by another name so lets have a look?
This is part 3 of an ongoing series where I explore my relationship with Perl. You may wish to begin at the beginning.
This week we look at the joys—and the frustrations—of Moose.
Last week I talked about why I believe that at least having the choice to program object-orientedly (without it being a huge pain in the ass) is vital to me as a programmer. In the comments I also touched briefly on why I think OOP in Perl, pre-Moose, is a huge pain in the ass, but honestly I didn’t put much effort into making that point. In my experience with other programmers (both in real life and online), the majority of them—perhaps 75%, at a rough guess—already agree with that and don’t need any convincing from me. And the rest are most likely not going to be convinced no matter what I say. Besides, this isn’t really a persuasive essay. I’m not trying to change anyone’s mind. It’s the story of my relationship with Perl. And I, like most other coders I know, have placed some value in OOP, at least in some circumstances. Also, I, like most other coders I know, felt that doing OOP in Perl was a bit of a chore.
Several Pinto users have asked how to install all the modules in any given stack within their repository. At first, my response was to create a Task module that declared all the dependencies you need, and let your installer unwind the dependencies from there. Or better still, organize your app itself into a CPAN-style distribution with the dependencies declared in a META file, and then stick it into your Pinto repository.
But not everyone was thrilled about those ideas. Some folks just want to stash stuff in the repository and then say "install it all". And now you can! Read on to learn more...
Until the past year I never truly appreciated how much faster make will build an executable when you are running on some heavy iron and use the -j option. As a p5p committer I have a shell account on dromedary, a server donated by booking.com++ and maintained by Dennis Kaarsemaker and friends (more ++). On that box I set TEST_JOBS=8, which enables me to configure, build and test perl so fast that I have never bothered to time it (probably less than 5 minutes).
Today, however, was the first time that I learned that running make -j${TEST_JOBS} can obscure the results of make.
I left off from my last D&D post still looking for a role, but at least I settle on simple base class 'Ability' which I will extend into six abilities.
Now looking at each ability they all have differing effects depending on the value. So lets look at 'Intelligence' this time. According to the 'rules' it seems the more Intelligence you have the more languages your character can speak,as well for Magic User characters it betters the chances of your character learning a 'spell', sets higher the maximum and minimum number of spells they can learn per level and sets the highest level spell they can use. It even limits you on what race or class your character can take on. However, having high intelligence does not impart spell ability it only enhances it if you happen to be a MU. Likewise very low inelegance does not stop you from speaking at least one language.
Although percentage wise the submissions are up, the actual number of respondents are just slightly lower than previous years. Though it has to be said I'm still pleased to get roughly a third of attendees submitting survey responses. It might not give a completely accurate picture of the event, but hopefully we still get a decent flavour of it.
The Perl 6 Advent Calendar, Day 18, in addition to show perl6's builtin grammar facility, was adressing a fundamental aspect of text processing, i.e. native unicode support in a grammar.
Indeed, if we say text processing, we say also characters-oriented framework. The perl6 example was the occasion to test Marpa::R2, and produce a tiny tutorial with it.
A card is a face followed immediately by a suit.
Perl6's definition:
token face {:i <[2..9]> | 10 | j | q | k | a }
proto token suit {*}
token suit:sym<♥> {}
token suit:sym<♦> {}
token suit:sym<♣> {}
token suit:sym<♠> {}
UPDATE [23 december, 2013] character class version:
My participation to the CPAN Once a Week contest forces me to find a module to create or update every week. And because I don't want to cheat, it has to be a meaningful change (I also try not to make a new Acme::MetaSyntactic release every week).
This week, I decided to look at my module list through the filter of CPAN Testers.
[One of them was really not looking good](
http://matrix.cpantesters.org/?dist=WWW-Gazetteer-HeavensAbove%200.18)