Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. when stage.signalReceived("rounding") {
  2. if(this.cloneId == 0) {
  3. this.good = 0;
  4. for(let i = 0; i < 3; i++) {
  5. this.good += this.getpoint(i, i, alist);
  6. this.good += this.getpoint(i + 3, i, blist);
  7. this.good += this.getpoint(i + 6, i, clist);
  8. }
  9. if(this.good == 9) {
  10. stage.broadcast("win");
  11. }
  12. else {
  13. stage.broadcast("asking");
  14. }
  15. }
  16. }
  17. when stage.signalReceived("asking") {
  18. if(this.cloneId == 0) {
  19. this.from = stage.ask("From which boatline do you want to move a yacht (1-left, 2-middle, 3-right)?");
  20. this.to = stage.ask("To which boatline do you want to move a yacht (1-left, 2-middle, 3-right)?");
  21. this.moving(alist, blist, 1, 2);
  22. this.moving(alist, clist, 1, 3);
  23. this.moving(blist, clist, 2, 3);
  24. this.moving(blist, alist, 2, 1);
  25. this.moving(clist, alist, 3, 1);
  26. this.moving(clist, blist, 3, 2);
  27. steps += 1;
  28. stage.broadcast("rounding");
  29. }
  30. }
  31. when stage.signalReceived("win") {
  32. this.deleteClone(this);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement