Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
[raku] How to use an object array in perl6by hsmyers (Canon) |
on Nov 17, 2019 at 20:52 UTC ( [id://11108830]=perlquestion: print w/replies, xml ) | Need Help?? |
hsmyers has asked for the wisdom of the Perl Monks concerning the following question: Once again I've become a perl beginner (do you ever stop?), except this time it's in perl6. Starting from ideas that I know well, I chose to redesign a portion of previous code of mine, in this case a chessboard. The first two classes went well (or at least worked, I know so little that I can't speak to their correctness…) but I'm stuck with the third. Here is the code:
The Board class (empty as it is) is all that is left from my attempts so far. Amazingly (at least to me) it provides a degree of workability!. It has variously had a "new" and a "BUILD", neither provided a working solution. Obviously the current approach doesn't work considering that the actual count will be 64 and not 4. My current notion is that I need to build an array of 64 Squares which in turn will create the needed pieces. I've tried to add to self with nothing working. Suggestions? --hsm "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Back to
Seekers of Perl Wisdom
|
|