C Braille Translator Activity

What is Braille?

Braille is a tactile writing system used by people with visual impairment. It is traditionally written with embossed paper. Braille users can read computer screens using refreshable braille displays. They can write braille with the original slate and stylus or type it on a braille writer, such as a portable braille notetaker or computer that prints with a braille embosser.

Activity

Write a program that translates ASCII text to Braille output. Use getchar() to read the input. An EOF (CTRL-D) terminates the program. You may assume that no input line is over 80 characters long. Output should be recognisable as Braille, the form of output could be o for a raised dot and . for a non-raised dot. Only the 26 alphabet characters and space are required for a minimal solution. All input characters not supported by your solution should be ignored. You are not allowed to use Unicode Braille characters. Vertical display of letters in Braille is acceptable. Bonus points for displaying Braille letters horizontally.

When your program is complete, it should run like this:

> gcc -o braille braille.c 
> ./braille 
hello world 
(CTRL-D) 
o .  o .  o .  o .  o .  . .  . o  o .  o .  o .  o o
o o  . o  o .  o .  . o  . .  o o  . o  o o  o .  . o
. .  . .  o .  o .  o .  . .  . o  o .  o .  o .  . .

  1. Download braille_translator.c into a directory named BrailleTranslator.
  2. Create an ActivityJournal.txt and estimate the time you will need to complete the program.
  3. Keep track of the number of times you attempt to compile your program and generate a compiler error of any type. Note that number in the Activity_Journal along with the actual time to complete the program.

To test your code, write unit tests, and you also may compare your program's output to this Online Braille Generator output.

Problem Breakdown

  1. Braille was the first writing system with binary encoding. The system as devised by Braille consists of two parts:
  2. Within an individual cell, the dot positions are arranged in two columns of three positions. A raised dot can appear in any of the six positions, producing sixty-four (26) possible patterns, including one in which there are no raised dots.
  3. A pattern is commonly described by listing the positions where dots are raised, the positions being universally numbered, from top to bottom, as 1 to 3 on the left and 4 to 6 on the right. For example, dot pattern 1-3-4 describe a cell with three dots raised, at the top and bottom in the left column and at the top of the right column: that is, the letter ⡉   m
  4. The first ten letters of the alphabet, a–j, use the upper four dot positions:
    ⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚ (black dots in the table below).
  5. The next ten letters, k–t, are identical to a–j, respectively, apart from the addition of a dot at position 3 (red dots in the table):
    ⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞
  6. The next ten letters (the next "decade") are the same again, but with dots also at positions both 3 and 6 (green dots). Here w was left out as not being a part of the official French alphabet at the time of Braille's life.
  7. Space in Braille is represented by a cell with no dots raised ( ⠀⠀).
Braille alphabet
Source: https://en.wikipedia.org/wiki/Braille

Submission

Submit your source file braille_translator.c and your ActivityJournal.txt in a top level directory named BrailleTranslator to your Git pushbox.

Grading Criteria

To receive full credit for this activity you do the following:

  1. Submit your work in a correctly named directory. This must be one of the top level directories in your repository.
  2. The program must compile without any warnings.
  3. The program must compile exactly as shown in the activity.
  4. Use good software style. Refer to the C Coding Standards document.
  5. Follow an incremental development approach.
  6. Write at least 3 unit tests; one per function.
  7. Complete the Activity Journal including the time estimate, plan, actual time, and observations.
  8. Display Braille letters horizontally for an additional 10%.
  9. Create Makefile for an additional 5%. Submit your Makefile in the same BrailleTranslator directory.