Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2. import java.util.ArrayList;
  3. import java.util.Collections;
  4.  
  5. public class Fermi {
  6. //private int a, b, c;
  7. private ArrayList <Integer> targetList;
  8.  
  9. public Fermi() {
  10. targetList = new ArrayList<Integer>();
  11. }
  12.  
  13. public void generateNum() {
  14. // loop through digits 0-9
  15. for(int i=0; i<10; i++) {
  16. targetList.add(i);
  17. //System.out.println(targets);
  18. }
  19. // generate 3 distinct numbers per shuffle
  20. Collections.shuffle(targetList);
  21. for(int n=0; n<3; n++) {
  22. targetList.add(n);
  23. System.out.println(targetList.get(n));
  24. }
  25.  
  26. System.out.println("Game Numbers " + targetList.get(0) + targetList.get(1) + targetList.get(2));
  27. System.out.println(targetList.get(2));
  28. }
  29.  
  30.  
  31. // public String hint(int a, int b, int c) {
  32. // // when ok button is clicked -- hints
  33. // System.out.println(targetList);
  34. //
  35. // String hint = "";
  36. //
  37. // // hints for Fermi
  38. // if (a == targetList.get(0)) {
  39. // hint += "Fermi ";
  40. // } if (b == targetList.get(1)) {
  41. // hint += "Fermi ";
  42. // } if (c == targetList.get(2)) {
  43. // hint += "Fermi ";
  44. // }
  45. //
  46. // // hints for Pico
  47. // if (a == targetList.get(1) || a == targetList.get(2)) {
  48. // hint += "Pico ";
  49. // } if (b == targetList.get(0) || b == targetList.get(2)) {
  50. // hint += "Pico ";
  51. // } if (c == targetList.get(0) || c == targetList.get(1)) {
  52. // hint += "Pico ";
  53. // }
  54. //
  55. // // hints for Nano
  56. // if (a != targetList.get(0) && a != targetList.get(1) && a != targetList.get(2)) {
  57. // hint += "Nano ";
  58. // } if (b != targetList.get(0) && b != targetList.get(1) && b != targetList.get(2)) {
  59. // hint += "Nano ";
  60. // } if (c != targetList.get(0) && c != targetList.get(1) && c != targetList.get(2)) {
  61. // hint += "Nano ";
  62. // }
  63.  
  64. // return hint;
  65.  
  66. // }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement