/** * Program: Solo, a computer solitarie card game. * By: MD, md@tomatesasesinos.com * Copyright 2007 * * License: GPL http://www.gnu.org/licences/gpl.html * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * File: globals.h * Contents: Constants and other things. */ #ifndef _GLOBALS_H_ #define _GLOBALS_H_ #include #include #include "SDL.h" #include "SDL_image.h" /*Carta con su estado*/ typedef struct _carta carta; struct _carta { int numCarta; int bocaArriba; }; #define BOCABAJO 0 #define BOCARRIBA 1 /*Sitios donde va haber cartas en el tablero*/ #define SACAR 0 #define OLVIDAR 1 #define PALO1 2 #define PALO2 3 #define PALO3 4 #define PALO4 5 #define FINMONTONES 6 #define COLUMNA1 6 #define COLUMNA2 7 #define COLUMNA3 8 #define COLUMNA4 9 #define COLUMNA5 10 #define COLUMNA6 11 #define COLUMNA7 12 #define FINCOLUMNAS 13 #define MANO 13 #define POSICIONESTABLERO 14 //Numero de cartas #define SINCARTA -1 #define REY 12 //Boleanas #define TRUE 1 #define FALSE 0 //En cada posicion o nÂș carta o -1 (no carta) carta tablero[POSICIONESTABLERO][52]; //52 cartas en cada posicion, maximo imposible pero no obstante int cartasTablero[POSICIONESTABLERO]; int escalerasTablero[FINCOLUMNAS-COLUMNA1]; // en cada columna NumeroCartas haciendo Escalera (bocaarriba claro) int baraja[52]; //Para repartir comienzan con sus numeros y finaliza con todos -1 /*FUNCIONES Y PROCEDIMIENTOS*/ void iniciarJuego(void); void repartirCartas(void); int quitarBaraja(int pos); //Saca una carta de la baraja de la posicion dada void meterPos(int posTablero,int naipe,int bocaArriba); void hacerSitio(int posTablero); void sacarCartaSacar(void); void retirarPos(int posTablero); void rellenarPilaSacar(void); void moverCarta(int origen,int destino); void moverCartaLegal(int origen,int destino); int moverPalos(int posTablero); void moverGrupoCartasLegal(int origen,int profundidadOrigen,int destino); //arrastrar grupos de cartas en escalera int victoria(void); #include "graficos.h" #endif