@@ -0,0 +1,1951 @@
+package com.javarush.task.task16.task1627;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A        OnlineGame onlineGame = new OnlineGame();%0A        onlineGame.start();%0A    %7D%0A%0A    public static class OnlineGame extends Thread %7B%0A        public static volatile boolean isWinnerFound = false;%0A%0A        public static List%3CString%3E steps = new ArrayList%3CString%3E();%0A%0A        static %7B%0A            steps.add(%22%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BE %D0%B8%D0%B3%D1%80%D1%8B%22);%0A            steps.add(%22%D0%A1%D0%B1%D0%BE%D1%80 %D1%80%D0%B5%D1%81%D1%83%D1%80%D1%81%D0%BE%D0%B2%22);%0A            steps.add(%22%D0%A0%D0%BE%D1%81%D1%82 %D1%8D%D0%BA%D0%BE%D0%BD%D0%BE%D0%BC%D0%B8%D0%BA%D0%B8%22);%0A            steps.add(%22%D0%A3%D0%B1%D0%B8%D0%B9%D1%81%D1%82%D0%B2%D0%BE %D0%B2%D1%80%D0%B0%D0%B3%D0%BE%D0%B2%22);%0A        %7D%0A%0A        protected Gamer gamer1 = new Gamer(%22Ivanov%22, 3);%0A        protected Gamer gamer2 = new Gamer(%22Petrov%22, 1);%0A        protected Gamer gamer3 = new Gamer(%22Sidorov%22, 5);%0A%0A        public void run() %7B%0A            gamer1.start();%0A            gamer2.start();%0A            gamer3.start();%0A%0A            while (!isWinnerFound) %7B%0A            %7D%0A            gamer1.interrupt();%0A            gamer2.interrupt();%0A            gamer3.interrupt();%0A        %7D%0A    %7D%0A%0A    public static class Gamer extends Thread %7B%0A        private int rating;%0A%0A        public Gamer(String name, int rating) %7B%0A            super(name);%0A            this.rating = rating;%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            //Add your code here - %D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D1%8C %D0%BA%D0%BE%D0%B4 %D1%82%D1%83%D1%82%0A            try %7B%0A                for (String s: OnlineGame.steps) %7B%0A                    System.out.printf(%22%25s:%25s%5Cn%22, this.getName(), s);%0A                    Thread.sleep(1000 / rating);%0A                %7D%0A                if (!OnlineGame.isWinnerFound) %7B%0A                    OnlineGame.isWinnerFound = true;%0A                    System.out.printf(%22%25s:%25s%5Cn%22, this.getName(), %22%D0%BF%D0%BE%D0%B1%D0%B5%D0%B4%D0%B8%D1%82%D0%B5%D0%BB%D1%8C!%22);%0A                %7D%0A            %7D catch (InterruptedException e) %7B%0A                System.out.printf(%22%25s:%25s%5Cn%22, this.getName(), %22%D0%BF%D1%80%D0%BE%D0%B8%D0%B3%D1%80%D0%B0%D0%BB%22);%0A            %7D%0A%0A        %7D%0A    %7D%0A%7D%0A

Complete task1627