# 2023 Day 7: Camel Cards

**URL:** https://forum.ada-lang.io/t/2023-day-7-camel-cards/577
**Category:** Advent of Code
**Tags:** spoilers
**Created:** [December 8, 2023, 1:54am UTC](https://forum.ada-lang.io/t/2023-day-7-camel-cards/577 "2023-12-08T01:54:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cantanima](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/cantanima/32/121_2.png) [@cantanima](https://forum.ada-lang.io/u/cantanima)
#### Post date: [December 8, 2023, 1:54am UTC](https://forum.ada-lang.io/t/2023-day-7-camel-cards/577/1 "2023-12-08T01:54:58Z")

</div>

I relied on enumerations. In both parts I sorted a vector containing all the hands. For part 2, I used an array over the enumerations, to remap the cards’ ranks:  
 ` New_Ranking : constant array (Face) of Natural := [Jack => 0, One => 1, Two => 2, Three => 3, Four => 4, Five => 5, -- etc.`  
   
That, and a rewrite of the ordering in part 1, did the trick.

---

<div class="post-metadata">

### Author: ![jere](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jere/32/87_2.png) [@jere](https://forum.ada-lang.io/u/jere)
#### Post date: [December 8, 2023, 8:06pm UTC](https://forum.ada-lang.io/t/2023-day-7-camel-cards/577/2 "2023-12-08T20:06:09Z")

</div>

I also used enumerations but I did it a bit closer to the parsing and used

```ada
   type Camel_Card is 
      ('2', 
       '3', 
       '4', 
       '5', 
       '6', 
       '7', 
       '8', 
       '9',
       'T', 
       'J', 
       'Q', 
       'K', 
       'A');

```

That way I could read in a character and append single quotes on each side and use Camel\_Card’Value() on it. I like your enumeration better as a client facing enumeration though.
