Skip to content

Instantly share code, notes, and snippets.

@sspboyd
Last active August 29, 2015 14:02
Show Gist options
  • Save sspboyd/a6bef4ddd7976e6dbd87 to your computer and use it in GitHub Desktop.
Save sspboyd/a6bef4ddd7976e6dbd87 to your computer and use it in GitHub Desktop.
quick sketch to figure out a general solution the rot_(5+3+8) email address type problem.
/*
index 1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526
input a b c d e f g h i j k l m n o p q r s t u v w x y z
output k l m n o p q r s t u v w x y z a b c d e f g h i j
*/
void setup() {
int range = 26;
int offset = 16;
for (int indx = 0; indx < range; indx++) {
int output = (indx + offset) % range;
println(indx + "%"+ offset + " = " + output);
}
}
void twoArray(){
// show the super manual way of creating two arrays of 26 letters. One normal and one offset
}
void ifElseWay(){
// show how to do it with an if/else statement
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment