{"id":179069,"date":"2013-05-08T02:42:03","date_gmt":"2013-05-07T22:42:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=179069"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=179069","title":{"rendered":"<span class=\"post_title\">\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u043c, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043f\u0438\u0448\u0443\u0442 \u0432 \u043a\u043d\u0438\u0436\u043a\u0430\u0445 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00bb). \u042d\u0442\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb (Rules Pattern). \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c, \u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441 \u043d\u0438\u043c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ae9\/fd4\/2ca\/ae9fd42caadf1cb138a60369e3444f62.jpg\"\/><\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0421\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/h5>\n<p>  \u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 if-\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u0436\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public double CalculateSomething(Condition condition) {     \/\/\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435     if(condition.First...) ...     \/\/\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435      if(condition.Second...) ...      \/\/\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u043e\u043c\u0435\u0440 \u043e\u0434\u0438\u043d     if(condition.AnotherFirst...)     {         \/\/\u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435         if(condition.First) ...         else...     }      \/\/\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u043e\u043c\u0435\u0440 \u0434\u0432\u0430     if(condition.AnotherSecond...)     {         \/\/\u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435         if(condition.Second) ...         else...     }      \/\/\u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c     if(condition.YetAnotherFirst)     {         \/\/...         if(condition.AnotherFirst && condition.Second) ...         else         {           ...         }     }     \/\/  O_o } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u043d\u0430\u043a\u043e\u043c\u043e? \u0418\u0442\u0430\u043a, \u043a\u0430\u043a\u0438\u0435 \u0442\u0443\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b?<\/p>\n<p>  <b>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 1:<\/b> \u0420\u0430\u0441\u0442\u0443\u0449\u0430\u044f \u0446\u0438\u043a\u043b\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0442\u043e \u0446\u0438\u043a\u043b\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 if-\u043e\u0432 \u0438 \u0446\u0438\u043a\u043b\u043e\u0432 c \u0443\u0447\u0435\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043a\u043e\u0434\u0430. <a href=\"http:\/\/www.mccabe.com\/pdf\/mccabe-nist235r.pdf\">\u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f<\/a>, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0446\u0438\u043a\u043b\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 10. \u0418\u0437 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0430\u0441\u0442\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f.<\/p>\n<p>  <b>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 2:<\/b> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0421 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0443\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043a\u0430\u043a.<\/p>\n<p>  <b>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 3:<\/b> \u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0434\u0435\u0440\u0435\u0432\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u043e, \u0442\u043e \u043f\u043e\u0440\u043e\u0439 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445. <\/p>\n<p>  \u0422\u0443\u0442 \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb. \u0415\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Uml-\u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/11b\/fe0\/218\/11bfe02186158a598eaa139a7716c18c.png\"\/>  <\/div>\n<\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043a\u043b\u0430\u0441\u0441 Evaluator \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IRule. Evaluator \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 C#.<\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440. \u0418\u0433\u0440\u0430 \u0432 \u043a\u043e\u0441\u0442\u0438 (\u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u00ab\u0422\u0430\u043b\u0438\u00bb)<\/h5>\n<p>  <b>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u0440\u044b:<\/b><\/p>\n<p>  \u0418\u0433\u0440\u043e\u043a \u043a\u0438\u0434\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e 5 \u043a\u0443\u0431\u0438\u043a\u043e\u0432, \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0447\u043a\u043e\u0432.<br \/>  \u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438: <br \/>  <code>1 X X X X<\/code> \u2014 100 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>5 X X X X <\/code> \u2014 50 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>1 1 1 X X<\/code> \u2014 1000 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>2 2 2 X X<\/code> \u2014 200 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>3 3 3 X X<\/code> \u2014 300 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>4 4 4 X X<\/code> \u2014 400 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>5 5 5 X X<\/code> \u2014 500 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>6 6 6 X X<\/code> \u2014 600 \u043e\u0447\u043a\u043e\u0432<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439:<br \/>  <code>[1,1,1,5,1]<\/code> \u2014 1150 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>[2,3,4,6,2]<\/code> \u2014 0 \u043e\u0447\u043a\u043e\u0432<br \/>  <code>[3,4,5,3,3] <\/code> \u2014 350 \u043e\u0447\u043a\u043e\u0432<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438, \u0438 \u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<h6>\u0414\u0435\u043b\u0430\u0439 \u0440\u0430\u0437! \u0411\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/h6>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0433\u0440\u044b \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb, \u0442\u0430\u043a, \u043a\u0430\u043a \u0431\u044b \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0430 \u0443\u0440\u043e\u043a\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438 \u0432 8-\u043c \u043a\u043b\u0430\u0441\u0441\u0435 (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 \u0441\u043d\u0430\u0431\u0434\u0438\u0432 \u043d\u0430\u0448 \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u2014 \u043a\u043e\u043c\u0443 \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b!)  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043b\u043e\u0445\u043e\u0439, \u043d\u0435\u0433\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Game<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class Game {   public int Score(int[] roles)   {     int score = 0;     for(int i=1; i&lt;7; i++)     {        int count = CountDiceWithValue(roles, i);       count = ScoreSetOfN(count, GetSetSize(i), SetSetScore(i), ref score);       score += count * GetSingleDieScore(i);     }     return score   }    private int GetSingleDieScore(int val)   {     if(val==1) return 100;     if(val==5) return 50;     return 0;   }    private int GetSetScore(int val)   {     if(val==1) return 1000;     return val*100;   }    private int GetSetSize(int val)   {     return 3;   }    private int ScoreSetOfN(int count, int setSize, int setScore, ref int score)   {     if(count&gt;=setSize)     {       score += setScore;       return count - 3;     }     return count;   }    private int CountDiceWithValue(int[] roles, int val)   {     int count = 0;     foreach (int r in roles)     {       if (r == val) count++;     }     return count;   } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h6>\u0414\u0435\u043b\u0430\u0439 \u0434\u0432\u0430! \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b? \u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/h6>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0431\u044b 50 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e. \u041d\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f?<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u043a\u0443\u0431\u0438\u043a\u043e\u0432:<\/p>\n<p>  <code>1 1 1 1 X<\/code> \u2014 2000<br \/>  <code>1 1 1 1 1<\/code> \u2014 4000<br \/>  <code>1 2 3 4 5<\/code> \u2014 8000<br \/>  <code>2 3 4 5 6 <\/code> \u2014 8000<br \/>  <code>A A B B X<\/code> \u2014 4000<br \/>  \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0440\u0438\u0441\u043a\u0443\u0435\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0439. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb.<br \/>  <i>(\u0417\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0430\u0434\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043f\u043e\u0431\u0443\u0440\u0447\u0430\u0442\u044c \u043e\u0431 \u0438\u0445 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u0434\u0430)<\/i><\/p>\n<h6>\u0414\u0435\u043b\u0430\u0439 \u0442\u0440\u0438! \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb<\/h6>\n<p>  1. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IRule<\/code> \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>Eval<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0447\u043a\u043e\u0432 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u0443\u0431\u0438\u043a\u043e\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">IRule.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public interface IRule {   ScoreResult Eval(int[] dice); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  2. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 <code>RuleSet<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b, \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u044b\u0431\u043e\u0440\u0430 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u043a\u0443\u0431\u0438\u043a\u043e\u0432:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">RuleSet.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class RuleSet {   \/\/\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b   private List&lt;IRlue&gt; _rules = new List&lt;IRule&gt;();      \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430   public void Add(IRule rule)   {     _rules.Add(rule);   }    \/\/\u043e\u0446\u0435\u043d\u043a\u0430 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 - \u0442\u043e\u0433\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0447\u043a\u043e\u0432   public IRule BestRule(int[] dice)   {     ScoreResult bestResult = new ScoreResult();     foreach(var rule in _rules)     {       var result = rule.Eval(dice);       if(result.Score &gt; bestResult.Score)       {         bestResult = result;       }       return bestResult.RuleUsed;     }   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  3. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043b\u0430\u0441\u0441-\u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ScoreResult.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class ScoreResult {   \/\/\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043e\u0447\u043a\u043e\u0432   public int Score {get;set;}    \/\/\u043a\u0430\u043a\u0438\u0435 \u043a\u0443\u0431\u0438\u043a\u0438 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b (\u0447\u0442\u043e\u0431\u044b \u043a\u0443\u0431\u0438\u043a \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438)   public int[] DiceUsed {get;set;}    \/\/\u043a\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u044b\u043b\u043e \u043b\u0443\u0447\u0448\u0438\u043c (\u0432 \u043c\u0435\u0442\u043e\u0434\u0435 BestRule)   public IRule RuleUsed {get;set;} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  4. \u0418 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ConcreteRules.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/\/\u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0438\u043a\u0430 public class SingleDieRule : IRule {   private readonly int _value;   private readonly int _score;    public SingleDieRule(int dieValue, int score)   {     _dieValue = dieValue,     _score = score   }    \/\/\u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 - \u043e\u0446\u0435\u043d\u043a\u0430 \u043e\u0447\u043a\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u0443\u0431\u0438\u043a\u043e\u0432   public ScoreResult Eval(int[] dice)   {     \/\/\u043a\u043b\u0430\u0441\u0441-\u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a     var result = new ScoreResult();     \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 \u043a\u0443\u0431\u0438\u043a\u0438 (\u043a\u0443\u0431\u0438\u043a\u0438 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u043e\u0447\u043a\u043e\u0432) - \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f     result.DiceUsed = dice.Where(d=&gt;d == dieValue).ToArray();     \/\/\u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043e\u0447\u043a\u043e\u0432     result.Score = result.DiceUsed.Count() * _score;     \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e - \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e \u043e\u0447\u043a\u0430\u043c     result.RuleUsed = this;      return result;   }  }  \/\/\u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0434\u0443\u0445\u0435 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  5. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>Evaluator <\/code>\u0441\u043e \u0441\u0445\u0435\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>Game<\/code>, \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b \u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043e\u0447\u043a\u043e\u0432  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Game.cs &#8212; Evaluator<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class Game {     private readonly RuleSet _ruleSet = new RuleSet();      public Game(bool useAllRules)     {       \/\/\u0441\u0442\u0430\u0440\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430       _ruleSet.Add(new SingleDieRule(1,100));       _ruleSet.Add(new SingleDieRule(5,50));       _ruleSet.Add(new TripleDieRule(1,1000));        for(int i=2; i&lt;7; i++)       {         _ruleSet.Add(new TripleDieRule(i, i*100));       }        \/\/\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430       if(useAllRules)       {           _ruleSet.Add(new FourOfADieRule(1,2000));           _ruleSet.Add(new SetOfADieRule(5,1,4000));           _ruleSet.Add(new StraightRule(8000));           _ruleSet.Add(new TwoPairsRule(6000));           for(int i=2; i&lt;7; i++)           {             _ruleSet.Add(new FourOfADieRule(i,i*200));             _ruleSet.Add(new SetOfADieRule(i,i*400));             \/\/...           }       }     }      \/\/\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0438\u0433\u0440\u0435 \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430     public void AddScoringRule(IRule rule)     {       _ruleSet.Add(rule);     }      \/\/\u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043e\u0447\u043a\u043e\u0432     public int Score(int[] dice)     {       int score = 0;       var remainingDice = new List&lt;int&gt;(dice);       var bestRule = _ruleSet.BestRule(remainingDice.ToArray());       \/\/\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0443\u0431\u0438\u043a\u043e\u0432 \u0441 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u0447\u043a\u0430\u043c\u0438       while(bestRule!=null)       {         var result = bestRule.Eval(remainingDice.ToArray());         foreach(var die in result.DiceUsed)         {           remainingDice.Remove(die);         }         score+=result.Score;         bestRule = _ruleSet.BestRule(remainingDice.ToArray());       }       return score;     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u0440\u0430! \u0417\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0435\u043d\u0430! \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u043c\u0443 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e, \u0446\u0438\u043a\u043b\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0440\u0430\u0441\u0442\u0435\u0442, <br \/>  \u0430 \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u044b\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>RuleSet<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b, \u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043e\u0447\u043a\u043e\u0432 \u2014 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>Game<\/code>.<\/p>\n<h6>\u041e \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c?<\/h6>\n<p>  \u041f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0443, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0432\u0438\u0434\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<br \/>   \u2014 \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0431\u044b\u0442\u044c read-only \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435?<br \/>   \u2014 \u0414\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u0431\u044b\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438? \u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b.<br \/>   \u2014 \u0414\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c? <br \/>   \u2014 \u0414\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b?<br \/>   \u2014 \u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430? <br \/>  \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<h5>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 (Business Rules Engines)<\/h5>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f Business Rules Engines \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0430 \u043a \u0438\u0434\u0435\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 <br \/>  \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u043a\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438\u043c\u0435\u0435\u0442 \u0438 Workflow Foundation \u043e\u0442 Microsoft.<\/p>\n<h5>\u0420\u0435\u0437\u044e\u043c\u0435<\/h5>\n<p>  1) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439<br \/>  2) \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0435\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0432 \u0441\u0432\u043e\u0438 \u043a\u043b\u0430\u0441\u0441\u044b<br \/>  3) \u041e\u0442\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u044b\u0431\u043e\u0440 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u2014 Evaluator<br \/>  4) \u0417\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u00ab\u0434\u0432\u0438\u0436\u043a\u043e\u0432\u044b\u0435\u00bb \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438<\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u044f \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<br \/>  <i>* \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b \u0443\u0440\u043e\u043a \u00abRules Pattern\u00bb \u0438\u0437 \u043a\u0443\u0440\u0441\u0430 \u00abDesign Patterns\u00bb \u0441\u0430\u0439\u0442\u0430 pluralsight.com \u043e\u0442 <a href=\"http:\/\/pluralsight.com\/training\/Authors\/Details\/steve-smith\">\u0421\u0442\u0438\u0432\u0430 \u0421\u043c\u0438\u0442\u0430<\/a><\/i>    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/179069\/\"> http:\/\/habrahabr.ru\/post\/179069\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u043c, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043f\u0438\u0448\u0443\u0442 \u0432 \u043a\u043d\u0438\u0436\u043a\u0430\u0445 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00bb). \u042d\u0442\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0440\u0430\u0432\u0438\u043b\u0430\u00bb (Rules Pattern). \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c, \u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441 \u043d\u0438\u043c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ae9\/fd4\/2ca\/ae9fd42caadf1cb138a60369e3444f62.jpg\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-179069","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=179069"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179069\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=179069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=179069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}