a simple Java-FX Application which Simulate the Approximation of Pi https://nextn.xyz
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
595 B

  1. package montecarlopi;
  2. public class Controller {
  3. private Model m = null;
  4. private View v = null;
  5. public Controller() {
  6. m = new Model();
  7. v = new View(this);
  8. m.addObserver(v);
  9. }
  10. public Model getModel() {
  11. return m;
  12. }
  13. public View getView() {
  14. return v;
  15. }
  16. public void addOne() {
  17. m.setExit(false);
  18. m.generatePoint();
  19. }
  20. public void addThousand() {
  21. m.setExit(false);
  22. for(int i = 0; i < 1000; i++) {
  23. m.generatePoint();
  24. }
  25. }
  26. }