Beispiel #1
0
int main ()
{
  Card card;
  Deck deck;

  //deck.shuffle ();
  //deck.print ();

  Deck hand = deck.subdeck (0, 4);
  hand.print ();

  card = deck.cards[13];
  cout << find (card, deck) << endl;
  cout << deck.find (card) << endl;
  cout << card.find (deck) << endl;
}
Beispiel #2
0
int
main(int argc, char* argv[])
{
	// Object Assembly
	cout << " * [Assembly Operations]" << endl;
	cout << " * Building deck...";
	Deck deck;
	cout << "done" << endl;
	cout << " * Building my card...";
	Card card (SPADES, TWO);
	cout << "done" << endl;
	cout << " * My Card is ";
	card.print();
	cout << endl;

	// Search operations
	cout << " * [Search Operations]" << endl;
	int index = 0;
	cout << " * Invoke deck.findBisect()...";
	index = deck.findBisect(card);
	cout << "done";
	cout << "; My Card found at index #" << index << endl;
	cout << " * Invoke card.findBisect()...";
	index = card.findBisect(deck);
	cout << "done";
	cout << "; My Card found at index #" << index << endl;
	cout << " * Invoke deck.find()...";
	index = deck.find(card);
	cout << "done";
	cout << "; My Card found at index #" << index << endl;
	cout << " * Invoke card.find()...";
	index = card.find(deck);
	cout << "done";
	cout << "; My Card found at index #" << index << endl;
	cout << endl;
	//deck.print();

	return 0;
}