Assignment 9: Braille Translator -- 4/27/2020

COSC 2200, Spring 2020

Marquette University, Department of Computer Science

Due: Wednesday, May 6th, 2020 at 11:59pm CDT
Submit: Turn in your source file using the turnin command on a Systems Lab machine. Please name your file "main.c". Failure to follow this simple convention will cause TA-Bot to fail.
Remember, the turnin command (to submit your file) will look like this:

turnin -c cosc2200 main.c

Work may be completed in teams of two. The names of both partners must appear in a comment block at the top of your file for credit to be given. I strongly recommend that you take the time to meet with your partner in person and work together on these projects, rather than work separately and try to integrate at the last minute. Use the command hook "TA-BOT:MAILTO" in a comment in your source files to designate mail addresses for TA-Bot output.

This UNIX tutorial may be of some assistance.

Preparation

I have provided a reference implementation on Morbius under ~pmcgee6/cosc2200/bin/braille-example.  Execute arm-console in this directory to run the reference implementation on a backend machine.

Braille Translator

Write a C program that reads in strings of ASCII characters, and converts the letters and numbers to Grade 1 English Braille. There are many Braille writing systems in common use today, but all depend upon a grid of raised dots that can be deciphered by touch. Grade 1 English Braille is a simple letter-by-letter transcription used for basic literacy, and is easier to encode than the more advanced contractions and abbreviations commonly used in Grade 2.

For our purposes each Braille cell will consist of six positions in a 3x2 rectangle, each of which can be raised or not. The upper left dot will be considered position 1, with positions 2 and 3 continuing down the left column, and positions 4, 5, and 6 in the right column from top to bottom. For clarity, our system will display the character '@' for a raised dot, and '.' for an unraised dot. The 64 possible combinations of dots can be represented as a 6-bit number; the provided template file already includes an array of hexadecimal bytes that encode the 41 dot combinations needed for this assignment.

In addition to the 26 lowercase alphabet letters and 10 numerical digits, our translation will include five special formatting marks. The Capital format mark ('⠠') appears in front of any capital letter. So, while a lowercase 'w' is represented by '⠺' in English Braille, the capital 'W' is "⠠⠺".

English Braille reuses the same first ten alphabet patterns for the ten decimal digits, '0' through '9', but prefixes them with the Number format mark, ('⠼'). For a string of contiguous digits, the Number mark only appears in front of the first digit. If a letter immediately follows a digit without any intervening space, it must then be preceded by the Capital or Letter ('⠰') format mark to make clear the transition back to alphabet letters.

Finally, unlike traditional U.S. English orthography, English Braille makes a distinction between the punctuation marks for period ('⠲' - the "full stop" at the end of a sentence,) and the radix point ('⠨' - the decimal point between the integer and fractional portion of a written number).