/* libass/ass_set.c * * Copyright (C) 1997 Timothy M. Vanderhoek * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Tim Vanderhoek * ac199@hwcn.org */ #include "ass.h" /* * This is a simple short-cut function you can use to verify that * a given set exists within a given hand. Returns TRUE iff it does, * and FALSE if it doesn't, or if something else is wrong. */ int ass_set ( hand_t hand, /* The hand to check */ set_t set /* Check for this set */ ) { int i, x; /* junk */ x = set->num; for (i=0; i < 54; i++) if (hand->cards[i] == set->card) x--; if (x <= 0) return 1; else return 0; }