Commits

Trammell Hudson committed d1fedf9

bad alternate

Comments (0)

Files changed (2)

words/src/Makefile

 SRCS += words.c
 
 FONTS := \
-	fonts/Courier.ttf:19 \
-	fonts/Courier-Bold.ttf:19 \
+	fonts/Courier.ttf:22 \
+	fonts/Courier-Bold.ttf:22 \
 
 include ../../Makefile.pebble

words/src/words.c

 	APP_INFO_WATCH_FACE
 );
 
-#define ROWS 10
+#define ROWS 9
 #define COLS 11
-#define FONT_H 16
-#define FONT_W 11
-#define FONT_ON		RESOURCE_ID_FONT_COURIER_BOLD_19
-#define FONT_OFF	RESOURCE_ID_FONT_COURIER_19
+#define FONT_H 19
+#define FONT_W 12
+#define FONT_ON		RESOURCE_ID_FONT_COURIER_BOLD_22
+#define FONT_OFF	RESOURCE_ID_FONT_COURIER_22
 
 
 typedef struct
 {
-	int row;
-	int col;
-	char text_on[8];
-	char text_off[8];
+	uint8_t p[8][2];
 } word_t;
 
 #define LAYER_FIVE	13
 #define LAYER_A		22
 #define LAYER_FILLER	23
 
+
+typedef struct {
+	uint8_t x;
+	uint8_t y;
+	uint8_t len;
+} word_t;
+
+/*
+ Official layout:
+  01234567890
+0 ITxISxxTIME
+1 AcQUARTERxx
+2 TWENTYFIVEx
+3 HALFxTENxTO
+4 PASTxxxNINE
+5 ONESIXTHREE
+6 FOURFIVETWO
+7 EIGHTELEVEN
+8 SEVENTWELVE
+9 TENxxOCLOCK
+
+ Alternate layout saves one row by sharing letters:
+
+  01234567890
+0 ITxISpebble
+1 xAxQUARTERx
+2 TWENTYxFIVE
+3 xxxPASTxSIX
+4 ONEIGHTHREE
+5 TENINELEVEN
+6 FIVETWOFOUR
+7 TWELVESEVEN
+8 OCLOCKxxNOW
+  01234567890
+*/
+
+static char [ROWS][COLS][2] = {
+	{ "I", "T", "x", "I", "S", "p", "e", "b", "b", "l", "e", },
+	{ "x", "A", "x", "Q", "U", "A", "R", "T", "E", "R", "x", },
+	{ "T", "W", "E", "N", "T", "Y", "x", "F", "I", "V", "E", },
+	{ "x", "x", "x", "P", "A", "S", "T", "x", "S", "I", "X", },
+	{ "O", "N", "E", "I", "G", "H", "T", "H", "R", "E", "E", },
+	{ "T", "E", "N", "I", "N", "E", "L", "E", "V", "E", "N", },
+	{ "F", "I", "V", "E", "T", "W", "O", "F", "O", "U", "R", },
+	{ "T", "W", "E", "L", "V", "E", "S", "E", "V", "E", "N", },
+	{ "O", "C", "L", "O", "C", "K", "x", "x", "N", "O", "W", },
+};
+
 static const word_t words[] = {
 	// Hours 1-12
-	[1] = {  5, 0, "ONE", "one" },
-	[2] = {  6, 8, "TWO", "two" },
-	[3] = {  5, 6, "THREE", "three" },
-	[4] = {  6, 0, "FOUR", "four" },
-	[5] = {  6, 4, "FIVE", "five" }, // hour
-	[6] = {  5, 3, "SIX", "six" },
-	[7] = {  8, 0, "SEVEN", "seven" },
-	[8] = {  7, 0, "EIGHT", "eight" },
-	[9] = {  4, 7, "NINE", "nine" },
-	[10] = {  9, 0, "TEN", "ten" }, // hour
-	[11] = {  7, 5, "ELEVEN", "eleven" },
-	[12] = {  8, 5, "TWELVE", "twelve" },
+	[1] = {  4, 0, sizeof("one") },
+	[2] = {  6, 4, sizeof("two") },
+	[3] = {  4, 6, sizeof("three)" },
+	[4] = {  6, 7, sizeof("four") },
+	[5] = {  6, 0, sizeof("five") },
+	[6] = {  3, 8, sizeof("six") },
+	[7] = {  7, 6, sizeof("seven")},
+	[8] = {  4, 2, sizeof("eight") },
+	[9] = {  5, 2, sizeof("nine") },
+	[10] = {  5, 0, sizeof("ten") },
+	[11] = {  5, 5, sizeof("eleven") },
+	[12] = {  7, 0, sizeof("twelve") },
 
 	// Minutes 13-
-	[LAYER_FIVE]	= {  2, 6, "FIVE", "five" }, // minute
+	[LAYER_FIVE]	= {  2, 7, sizeof("five") }, // minute
 	[LAYER_TEN]	= {  3, 5, "TEN", "ten" }, // minute
 	[LAYER_A]	= {  1, 0, "A", "a" },
 	[LAYER_QUARTER]	= {  1, 2, "QUARTER", "quarter" },