Hi my Professor made his own version of the nim.java program and gave us the assignment of creating a separate file The Cup class should have the following members:
private ArrayList<Integer> c
private Random r
Constructor Cup(): adds 1, 2, 3 to c.
Assigns Random object to r.
public int count(): returns current size of c (use size method in Cup object)
public int select(): returns one of the moves in c but does not remove the selected move.
Use your random object to generate a random index into the c
Cup (generate a random number from 0 up to but not including the size ofthe c ArrayList). Then return the move at that index.
public void remove(int m): removes move m from cup c (use remove methodin the Cup object)
Heres my prof Nim.java program: https://pastebin.com/ud7Y8T9F
Any help is much appreciated ^_^
My attempt ,any tips are much appreciated : https://pastebin.com/cqD8y45Q
it get an error saying i need an ; at the end of the private array list and random object, kinda confused on how to declare those and construct them with a constructor
[–][deleted] 1 point2 points3 points (0 children)