There is a small information leak: if you know (from Peek Deck) that the deck contains a card X somewhere, and then you draw card X which happens not to be the seen card X in the internal structure, you can still see from the 'v' output that there is another X card hiding in there.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2692 c06c8d41-db1a-0410-9941-cceddc491573
OQXMUX5JEITCP2QXJKKOQRLRVTD3LTSDWGI6HTK5GVDIAJ7VKO6AC description += "$Next card(s): ";description += card_name(static_cast<card_type>(item.plus2 - 1));long spec = item.special;while ( spec )
const int num_cards = cards_in_deck(item);if ( top_card_is_known(item) ){description += "Next card(s): ";for ( int i = 0; i < num_cards; ++i ){unsigned char flags;const card_type card = get_card_and_flags(item, -i-1, flags);if ( flags & CFLAG_MARKED ){if ( i != 0 )description += ", ";description += card_name(card);}elsebreak;}}std::vector<card_type> seen_cards;for ( int i = 0; i < num_cards; ++i ){unsigned char flags;const card_type card = get_card_and_flags(item, -i-1, flags);// This *might* leak a bit of information...oh well.if ( (flags & CFLAG_SEEN) && !(flags & CFLAG_MARKED) )seen_cards.push_back(card);}if ( !seen_cards.empty() )
description += ", ";description += card_name(static_cast<card_type>((spec & 0xFF)-1));spec >>= 8;
std::sort(seen_cards.begin(), seen_cards.end(),compare_card_names);description += "$Seen cards: ";for ( unsigned int i = 0; i < seen_cards.size(); ++i ){if ( i != 0 )description += ", ";description += card_name(seen_cards[i]);}