Created
February 6, 2015 06:15
-
-
Save syneart/517718c3b28c0bfb9d34 to your computer and use it in GitHub Desktop.
小數值打亂程式碼片段 (Android/Java)
This file contains 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
int MaxVal = 5; // Max | |
ArrayList<Integer> list=new ArrayList<Integer>(); | |
for (int i = 1; i <= MaxVal; i++) { | |
list.add(i); | |
} | |
Collections.shuffle(list); | |
for(Integer result:list) { | |
Log.e("ValOut", result+""); // Result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment