Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

351
Vistas
How to set values for cards in a card deck and compare which one has "higher" or "lower" value?

How to compare card values or even store them ?

I'm pulling data from an API that gives me 1 card - and then I want to compare their values to see which one is higher with the next card.. how can I do something like that ?

My values are pulled from an API and they return 'K' for King, or '5' for 5, 'A' for Ace and so on.. but I'm not sure how could I compare values of different types together ?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can use a dictionary.

var cards = {
 'A' = 14, // Ace
 'K' = 13  // King
}

Or you can use an enum like object:

const Cards = {
  A: 14, // Ace
  K: 13  // King
};
   
about 4 years ago · Juan Pablo Isaza Denunciar

0

Create a Card-class and make it either Comparable more write a Comparator<Card>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda