Advertisement
mikhail_dvorkin

NimController

Feb 27th, 2017
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. package me.dvorkin;
  2.  
  3. public class NimController {
  4.     NimModel model;
  5.     NimConsoleView consoleView;
  6.    
  7.     public NimController(NimModel model, NimConsoleView consoleView) {
  8.         this.model = model;
  9.         this.consoleView = consoleView;
  10.     }
  11.    
  12.     public void run() {
  13.         while (!model.isOver()) {
  14.             int[] move = consoleView.interact();
  15.             model.update(move[0], move[1]);
  16.         }
  17. //      consoleView.congratulate();
  18.     }
  19.  
  20.     public static void main(String[] args) {
  21.         NimModel model = new NimModel();
  22.         NimConsoleView consoleView = new NimConsoleView(model);
  23.         NimController controller = new NimController(model, consoleView);
  24.         controller.run();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement