Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Collections;
- public class Fermi {
- //private int a, b, c;
- private ArrayList <Integer> targetList;
- public Fermi() {
- targetList = new ArrayList<Integer>();
- }
- public void generateNum() {
- // loop through digits 0-9
- for(int i=0; i<10; i++) {
- targetList.add(i);
- //System.out.println(targets);
- }
- // generate 3 distinct numbers per shuffle
- Collections.shuffle(targetList);
- for(int n=0; n<3; n++) {
- targetList.add(n);
- System.out.println(targetList.get(n));
- }
- System.out.println("Game Numbers " + targetList.get(0) + targetList.get(1) + targetList.get(2));
- System.out.println(targetList.get(2));
- }
- // public String hint(int a, int b, int c) {
- // // when ok button is clicked -- hints
- // System.out.println(targetList);
- //
- // String hint = "";
- //
- // // hints for Fermi
- // if (a == targetList.get(0)) {
- // hint += "Fermi ";
- // } if (b == targetList.get(1)) {
- // hint += "Fermi ";
- // } if (c == targetList.get(2)) {
- // hint += "Fermi ";
- // }
- //
- // // hints for Pico
- // if (a == targetList.get(1) || a == targetList.get(2)) {
- // hint += "Pico ";
- // } if (b == targetList.get(0) || b == targetList.get(2)) {
- // hint += "Pico ";
- // } if (c == targetList.get(0) || c == targetList.get(1)) {
- // hint += "Pico ";
- // }
- //
- // // hints for Nano
- // if (a != targetList.get(0) && a != targetList.get(1) && a != targetList.get(2)) {
- // hint += "Nano ";
- // } if (b != targetList.get(0) && b != targetList.get(1) && b != targetList.get(2)) {
- // hint += "Nano ";
- // } if (c != targetList.get(0) && c != targetList.get(1) && c != targetList.get(2)) {
- // hint += "Nano ";
- // }
- // return hint;
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement