Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1.  
  2. import java.security.SecureRandom;
  3. import java.util.Random;
  4.  
  5. /*
  6. * To change this license header, choose License Headers in Project Properties.
  7. * To change this template file, choose Tools | Templates
  8. * and open the template in the editor.
  9. */
  10. /**
  11. *
  12. * @author Alan, Pai
  13. */
  14. public class baralho {
  15.  
  16. baralho() {
  17. //
  18. }
  19.  
  20. public void adiciona() {
  21.  
  22. int[] volume = new int[13];
  23. // int[]
  24. SecureRandom srandom = new SecureRandom();
  25. Random random = new Random();
  26.  
  27. int n = 0;
  28. for (int i = 0; i < 13; i++) {
  29. n = n + 1;
  30.  
  31. System.out.println("Rsultado: " + random.nextInt(n));
  32.  
  33. volume[i] = n;//random.nextInt(51);
  34. if (n == 13) {
  35. n = 0;
  36. }
  37. //System.out.println("Rsultado: " + random.nextInt(n));
  38. }
  39. //for (int i = 0; i < 13; i++) {
  40. //System.out.println(random.nextInt(13));
  41. // System.out.println(volume[i]);
  42. //}
  43.  
  44. }
  45.  
  46. public void geraRandom() {
  47. SecureRandom srandom = new SecureRandom();
  48.  
  49. int[] aleatorio = new int[13];
  50. int aux = 0;
  51. //for (int i = 0; i < 14; i++) {
  52. aleatorio.setSeed(20);
  53. System.out.println("Resultado: " + aleatorio.nextInt());
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement