Skip to content

Instantly share code, notes, and snippets.

@shalk
Last active March 25, 2019 10:12
Show Gist options
  • Save shalk/1574fe9e54870b4c11a99e603ac1e337 to your computer and use it in GitHub Desktop.
Save shalk/1574fe9e54870b4c11a99e603ac1e337 to your computer and use it in GitHub Desktop.
Coin4j
import java.util.Random;
import java.util.concurrent.TimeUnit;
public class Coin {
public static void main(String[] args) throws InterruptedException {
String[] candidates = new String[]{"🌝", "πŸŒ–", "πŸŒ—", "🌘", "🌚", "πŸŒ’", "πŸŒ“", "πŸŒ”"};
Random r = new Random();
for (int i = 0; i < 3; i++) {
for (String s : candidates) {
System.out.print(s);
TimeUnit.MILLISECONDS.sleep(42);
System.out.print("\b\b");
}
}
System.out.println(r.nextBoolean() ? "🌝" : "🌚");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment