Created
July 19, 2016 22:03
-
-
Save dougrchamberlain/bc0422203b6859c130b62905d0895a71 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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