Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- when stage.signalReceived("rounding") {
- if(this.cloneId == 0) {
- this.good = 0;
- for(let i = 0; i < 3; i++) {
- this.good += this.getpoint(i, i, alist);
- this.good += this.getpoint(i + 3, i, blist);
- this.good += this.getpoint(i + 6, i, clist);
- }
- if(this.good == 9) {
- stage.broadcast("win");
- }
- else {
- stage.broadcast("asking");
- }
- }
- }
- when stage.signalReceived("asking") {
- if(this.cloneId == 0) {
- this.from = stage.ask("From which boatline do you want to move a yacht (1-left, 2-middle, 3-right)?");
- this.to = stage.ask("To which boatline do you want to move a yacht (1-left, 2-middle, 3-right)?");
- this.moving(alist, blist, 1, 2);
- this.moving(alist, clist, 1, 3);
- this.moving(blist, clist, 2, 3);
- this.moving(blist, alist, 2, 1);
- this.moving(clist, alist, 3, 1);
- this.moving(clist, blist, 3, 2);
- steps += 1;
- stage.broadcast("rounding");
- }
- }
- when stage.signalReceived("win") {
- this.deleteClone(this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement