#text #format #combine-text

seven_seg

Seven-segment digital display for terminal

1 unstable release

0.1.2 May 30, 2023

#1636 in Text processing

GPL-3.0-or-later

46KB
1K SLoC

seven_seg

Pseudo seven segment digital display.

Examples

 use seven_seg::sevseg_four;
 let four_digits = sevseg_four("8023").unwrap();
 assert_eq!(&four_digits, "┏━━━┓ ┏━━━┓ ╺━━━┓ ╺━━━┓\n\
                           ┃   ┃ ┃   ┃     ┃     ┃\n\
                           ┣━━━┫ ┃   ┃ ┏━━━┛ ╺━━━┫\n\
                           ┃   ┃ ┃   ┃ ┃         ┃\n\
                           ┗━━━┛ ┗━━━┛ ┗━━━╸ ╺━━━┛\n"
 );
 

Example cpu_freg.rs from the examples folder.

License

GNU General Public License v3.0


lib.rs:

Pseudo seven segment digital display.

One, two, three and four digits. One digit, it can be a string of numbers from zero to nine or a dash no value.

Examples

let four_digits = sevseg_four("8023").unwrap();

assert_eq!(&four_digits, "┏━━━┓ ┏━━━┓ ╺━━━┓ ╺━━━┓\n\
                          ┃   ┃ ┃   ┃     ┃     ┃\n\
                          ┣━━━┫ ┃   ┃ ┏━━━┛ ╺━━━┫\n\
                          ┃   ┃ ┃   ┃ ┃         ┃\n\
                          ┗━━━┛ ┗━━━┛ ┗━━━╸ ╺━━━┛\n"
);

Dependencies

~370KB