Skip to content

Instantly share code, notes, and snippets.

@ijoshsmith
Created July 19, 2016 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoshsmith/f63dae6d309e12e68c02d523e1b7962e to your computer and use it in GitHub Desktop.
Save ijoshsmith/f63dae6d309e12e68c02d523e1b7962e to your computer and use it in GitHub Desktop.
Morse code data model
/// Represents an entire Morse encoded message.
struct EncodedMessage { let encodedTerms: [EncodedTerm] }
/// Represents a word or number consisting of Morse code symbols.
struct EncodedTerm { let symbols: [Symbol] }
/// Represents a character encoded with Morse code marks.
struct Symbol { let marks: [Mark] }
/// Represents an individual component of a Morse code symbol.
enum Mark: String { case Dot = ".", Dash = "-" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment