Problema uso de tag
Buenas, ando en busca de ayuda. Estoy haciendo un TATETI entre dos jugadores humanos, y me surgió un problema al momento de verificar quien gana. el código es este ..
tengo 9 imágenes y cada ves que uno de los jugadores hace click en una de las imágenes en teoría carga un valor en la matriz, 1 si es el jugador 1 o 2 si es el jugador 2. Lo que había hecho es ponerle a cada una de las imágenes ponerle un tag de 1 a 9, pero me di cuenta de que el problema esta en que no cargo la matriz con ningún valor. Gracias de antemano. Pd: el cartel de hola esta de mas pero era para ver si me cargaba la matriz . |
Buenas,
Si entiendo bien, al evaluar la propiedad Tag de uno de los TImage en ese evento debería ser con algo como:
Como soy criticón, creería que ese código se puede mejorar cambiando la cascada de if por un case of, quitándole el sleep y ... en fin, son gustos. - |
Muchas gracias me solucionaste el problema , te comento pensé en hacerlo con un case pero tenia problemas de sintaxis así que preferí anidar if con tal de que funcionara, igualmente ya solucione lo del case y ahora funciona perfecto. Lo que me decís del sleep, no se que decirte por que es algo decorativo, es un shape que se mueve de una posición a otra y como era muy brusco el movimiento le puse el sleep para que se notara el movimiento, pero es muy probable que halla una manera mejor de hacerlo si te interesa coméntame que te parece. Gracias me sirvió tu ayuda.
|
Creo que aquí hay un problema...:D
Saludos cordiales... |
Amigo te propongo esta modificación a tu algoritmo...
Saludos cordiales |
A mira esta buena esa, ahora que la veo capas que me sirve mas que la que implemente yo, por que me quedo medio feo (o del todo :P) el tema de ver quien gana o si empatan
Voy a ver que hago si encuentro una forma mas practica de encontrar ganador/empate en mi algoritmo o implemento el que vos decís y pruebo. escucho cualquier sugerencia :p estoy complicado con el tema, hace poco arranque a estudiar delphi así que todo me sirve. Les agradezco por ayudarme desde ya. |
Te propongo este código...espero te sirva...
Saludos cordiales |
Muchas gracias por tu ayuda, ya esta andando perfecto el tateti, gracias por la explicación!
|
La franja horaria es GMT +2. Ahora son las 19:00:16. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi