Skip to content

Instantly share code, notes, and snippets.

@dce
Created September 20, 2012 18:38
Show Gist options
  • Save dce/3757584 to your computer and use it in GitHub Desktop.
Save dce/3757584 to your computer and use it in GitHub Desktop.

encode.c

Simple exercise for learning C:

  • Reads text from STDIN
  • By default, rotates all text by one character ("abc" => "bcd")
  • Prints to STDOUT
  • If the "-n [number]" flag is supplied, rotate by that many characters
  • If the "-d" (decode) flag is supplied, rotate in the opposite direction
  • If the "-f [filename]" flag is supplied, read from that file rather than STDIN
@dce
Copy link
Author

dce commented Sep 24, 2012

Yeah, I'd say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment