]> git.earman.xyz Git - sensor-watch.git/commitdiff
Documented face
authorDavid Volovskiy <devolov@gmail.com>
Wed, 3 Sep 2025 11:46:38 +0000 (07:46 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Wed, 3 Sep 2025 11:46:38 +0000 (07:46 -0400)
watch-faces/complication/blackjack_face.c
watch-faces/complication/blackjack_face.h

index ee49042607ae0171753ad068a7ad7fa11dc67604..c9c7a3cdae623906787764cd5e5d287e9105b551 100755 (executable)
 #include "blackjack_face.h"\r
 #include "watch_common_display.h"\r
 \r
-#define ACE    13\r
-#define KING   12\r
-#define QUEEN  11\r
-#define JACK   10\r
+#define ACE    14\r
+#define KING   13\r
+#define QUEEN  12\r
+#define JACK   11\r
 \r
 #define MIN_CARD_VALUE 2\r
 #define MAX_CARD_VALUE ACE\r
@@ -180,7 +180,10 @@ static void display_card_at_position(uint8_t card, uint8_t display_position) {
             watch_display_character('-', display_position);\r
             break;\r
         case ACE:\r
-            watch_display_character('A', display_position);\r
+            watch_display_character(watch_get_lcd_type() == WATCH_LCD_TYPE_CUSTOM ? 'A' : 'a', display_position);\r
+            break;\r
+        case 10:\r
+            watch_display_character('0', display_position);\r
             break;\r
         default: {\r
             const char display_char = card + '0';\r
index ff52d79fdade8b422275ab823a3cab6b9dbec1e2..8771561c1b6b0c8da4340cde16228c4c0de584c2 100755 (executable)
  * Blackjack face\r
  * ======================\r
  *\r
+ * Simple blackjack game.\r
+ *\r
+ * Aces are 11 unless you'd but, and if so, they become 1.\r
+ * King, Queen, and jack are all 10 points.\r
+ * Dealer deals to themselves until they get at least 17.\r
+ * The game plays with one shuffled deck that gets reshuffled with every game.\r
+ * \r
+ * Press either ALARM or LIGHT to begin playing.\r
+ * Your score is in the Seconds position.\r
+ * The dealer's score is in the Top-Right position.\r
+ * The dealer's last-shown card is in the Top-Left position.\r
+ * Your cards are in the Bottom row. From left to right, they are oldest to newest. Up to four cards will be dislayed.\r
+ * \r
+ * To hit, press the ALARM button.\r
+ * To stand, press the LIGHT button.\r
+ * If you're at 21, you cannoy hit, since we just assume it's a mispress on the button.\r
+ * \r
+ * Once you stand, the dealer will deal out to themselves once per second (or immidietly when you press the LIGHT or ALARM buttons).\r
+ * The game results are:\r
+ * WIN: You have a higher score than the dealer, but no more than 21. Or the dealer's score is over 21.\r
+ * LOSE: Your score is lower than the dealer's.\r
+ * BUST: Your score is above 21.\r
+ * TIE: Your score matches the dealer's final score\r
+ * \r
+ * | Cards   |                          |\r
+ * |---------|--------------------------|\r
+ * | Value   |2|3|4|5|6|7|8|9|10|J|Q|K|A|\r
+ * | Display |2|3|4|5|6|7|8|9| 0|-|=|≡|a|\r
+ * If you're using a custom display, Ace will display as 'A', not 'a'\r
  */\r
 \r
 \r