Skip to content

Instantly share code, notes, and snippets.

@dougrchamberlain
Created July 19, 2016 22:03
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 dougrchamberlain/bc0422203b6859c130b62905d0895a71 to your computer and use it in GitHub Desktop.
Save dougrchamberlain/bc0422203b6859c130b62905d0895a71 to your computer and use it in GitHub Desktop.
char[] inputString = "abcdefghijklmnopqrstuvwxyz ".toCharArray();
char[] row = new char[16];
int inputStringCursor = 0;
int rowCursor = 15;
row[15] = inputString[inputStringCursor];
while(inputStringCursor < inputString.length - 1){
for(int i = 15; i >= 0; i--){
if(row[i] == 0){
}
else{
rowCursor = i;
}
}
while(rowCursor <= row.length - 1){
if(rowCursor != 0){
row[rowCursor - 1] = row[rowCursor];
}
rowCursor++;
}
inputStringCursor++;
row[15] = inputString[inputStringCursor];
System.out.println((new String(row)).replace('\u0000',' '));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment