Here is a small code snippets for displaying famous charactor circle on the console.... you may enjoy it!!!
private String circle() {
if ((System.currentTimeMillis() - startTime) < 100) {
startTime = System.currentTimeMillis();
return "\r" + current + "\t";
}
if (current == '|') {
current = '/';
} else if (current == '/') {
current = '-';
} else if (current == '-') {
current = '\\';
} else {
current = '|';
}
return "\r" + current + "\t";
}
No comments:
Post a Comment