Games:...::Card(3pm)

πŸ“¦
version 0.2601 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

okay so bestie, this page is Games:...::Card(3pm) β€” straight out of the User Contributed Perl Documentation β€” and it's literally just a class wrapper for one single, individual Solitaire card. one card. that's the whole vibe. she's a tiny queen and she contains multitudes ✨


🌸 VERSION 🌸

version 0.2601 β€” yes she's numbered, yes she's iconic


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole entrance, no notes:

use Games::Solitaire::Verify::Card;

# Initialise a Queen-of-Hearts
my $queen_of_hearts = Games::Solitaire::Verify::Card->new(
    {
        string => "QH",
        id => 4,
        data => { %DATA },
    },
);

look at her. a Queen of Hearts. born to be constructed with a string, an id, and some data. main character energy fr fr πŸ’…


✨ METHODS ✨

every method, no skips, let's go 🫢

πŸƒ $class->get_suits_seq()

hands you back the expected sequence of the suits, and that sequence is "H", "S", "C", "D". that's it. that's the order. periodt.

πŸ”’ $class->calc_rank($rank_string)

does the math and gives you the numerical rank of whatever string you passed in as the argument.

Example:

my $ten = Games::Solitaire::Verify::Card->calc_rank("T")
# Prints 10.
print "$ten\n";

"T" in, 10 out. slay.

0️⃣ $class->calc_rank_with_0($rank_string)

same exact energy as calc_rank, except it also supports "0" as the zero'th card. lowkey inclusive of zero, we love that.

πŸ—‚ $card->data()

arbitrary data that's associated with the card. can hold any scalar. anything. a string, a number, a reference, whatever your heart desires β€” no cap.

πŸ†” $card->id()

a simple identifier that identifies the card. should be a string, bestie. keep it a string.

πŸ† $card->rank()

returns the rank of the card as an integer. so: Ace is 1, 2-10 are 2-10, J is 11, Q is 12, and K is 13. the whole monarchy accounted for πŸ‘‘

β™₯️ $card->suit()

returns "H", "C", "D" or "S" depending on the suit. pick your fighter.

🎨 $card->color()

returns "red" or "black" depending on the rank of the card.

🌈 $card->color_for_suit($suit)

gets you the color of the suit $suit β€” and heads up, that suit might be different than the card's suit. so you can ask about a suit that isn't even hers. versatile.

πŸ‘― my $copy = $card->clone();

clones the card into a new copy. two cards, zero drama, identical twins πŸ¦‹

πŸ“ $card->to_string()

converts the card to a string representation. the glow-up into text format.

⚑ $card->fast_s()

a cached string representation. > use with care. that's the actual warning, i'm not being dramatic, she said use with care and i'm passing the message along πŸ’€

πŸ”€ $class->rank_to_string($rank_idx)

converts the rank to a string. reverse uno of the rank math.

πŸ“š my [@ranks] = $class->get_ranks_strings()

returns an (effectively constant) array reference of rank strings.

( Added in version 0.17 .)

πŸ”„ $card->is_flipped()

determines if the card is flipped. face up or face down, we simply must know.

πŸ”ƒ $card->set_flipped($flipped_bool)

sets the card's flipped status. you hold the power, bestie.


🫢 SUPPORT 🫢

🌐 Websites

the following websites have more information about this module, and may be of help to you. as always, in addition to those websites please use your favorite search engine to discover more resources. (yes, googling is valid, we stan a resourceful queen)

πŸ› Bugs / Feature Requests

please report any bugs or feature requests by email to bug-games-solitaire-verify at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=Games-Solitaire-Verify>. you will be automatically notified of any progress on the request by the system. auto-notifications? we love being kept in the loop πŸ’Œ

πŸ’» Source Code

the code is open to the world, and available for you to hack on. please feel free to browse it and play with it, or whatever. if you want to contribute patches, please send me a diff or prod me to pull from your repository :)

<https://github.com/shlomif/fc-solve>

git clone git://github.com/shlomif/fc-solve.git

πŸ‘‘ AUTHOR πŸ‘‘

Shlomi Fish <shlomif@cpan.org>


πŸ’€ BUGS πŸ’€

please report any bugs or feature requests on the bugtracker website <https://github.com/shlomif/fc-solve/issues>

when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. (a test file is the love language of a maintainer, fr fr, no cap, it's giving thoughtful πŸŽ€)


this software is Copyright (c) 2008 by Shlomi Fish.

this is free software, licensed under:

The MIT (X11) License

and that's the whole page, bestie πŸ’– this was Games:...::Card(3pm) from the User Contributed Perl Documentation, living on perl v5.42.0, dated 2025-07-25. go forth and shuffle, you absolute icon πŸŒˆπŸ¦‹βœ¨

πŸ“¦ where this page comes from