265 static const char segments[30][8] =
266 { { 0, 1, 2, 4, 5, 6,99, 0},
267 { 2, 5,99, 0, 0, 0, 0, 0},
268 { 0, 2, 3, 4, 6,99, 0, 0},
269 { 0, 2, 3, 5, 6,99, 0, 0},
270 { 1, 2, 3, 5,99, 0, 0, 0},
271 { 0, 1, 3, 5, 6,99, 0, 0},
272 { 0, 1, 3, 4, 5, 6,99, 0},
273 { 0, 2, 5,99, 0, 0, 0, 0},
274 { 0, 1, 2, 3, 4, 5, 6,99},
275 { 0, 1, 2, 3, 5, 6,99, 0},
276 { 3,99, 0, 0, 0, 0, 0, 0},
277 { 7,99, 0, 0, 0, 0, 0, 0},
278 { 0, 1, 2, 3, 4, 5,99, 0},
279 { 1, 3, 4, 5, 6,99, 0, 0},
280 { 0, 1, 4, 6,99, 0, 0, 0},
281 { 2, 3, 4, 5, 6,99, 0, 0},
282 { 0, 1, 3, 4, 6,99, 0, 0},
283 { 0, 1, 3, 4,99, 0, 0, 0},
284 { 1, 3, 4, 5,99, 0, 0, 0},
285 { 1, 2, 3, 4, 5,99, 0, 0},
286 { 1, 4, 6,99, 0, 0, 0, 0},
287 { 3, 4, 5, 6,99, 0, 0, 0},
288 { 0, 1, 2, 3, 4,99, 0, 0},
289 { 3, 4,99, 0, 0, 0, 0, 0},
290 { 4, 5, 6,99, 0, 0, 0, 0},
291 { 1, 2, 4, 5, 6,99, 0, 0},
292 { 1, 2, 3, 5, 6,99, 0, 0},
293 { 8, 9,99, 0, 0, 0, 0, 0},
294 { 0, 1, 2, 3,99, 0, 0, 0},
295 {99, 0, 0, 0, 0, 0, 0, 0} };
297 if (ch >=
'0' && ch <=
'9')
298 return segments[ch -
'0'];
299 if (ch >=
'A' && ch <=
'F')
300 return segments[ch -
'A' + 12];
301 if (ch >=
'a' && ch <=
'f')
302 return segments[ch -
'a' + 12];