Нема описа

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. <!DOCTYPE html><html><head><meta charset="utf-8"><style>body {
  2. width: 45em;
  3. border: 1px solid #ddd;
  4. outline: 1300px solid #fff;
  5. margin: 16px auto;
  6. }
  7. body .markdown-body
  8. {
  9. padding: 30px;
  10. }
  11. @font-face {
  12. font-family: octicons-anchor;
  13. src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
  14. }
  15. .markdown-body {
  16. -ms-text-size-adjust: 100%;
  17. -webkit-text-size-adjust: 100%;
  18. color: #333;
  19. overflow: hidden;
  20. font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
  21. font-size: 16px;
  22. line-height: 1.6;
  23. word-wrap: break-word;
  24. }
  25. .markdown-body a {
  26. background: transparent;
  27. }
  28. .markdown-body a:active,
  29. .markdown-body a:hover {
  30. outline: 0;
  31. }
  32. .markdown-body strong {
  33. font-weight: bold;
  34. }
  35. .markdown-body h1 {
  36. font-size: 2em;
  37. margin: 0.67em 0;
  38. }
  39. .markdown-body img {
  40. border: 0;
  41. }
  42. .markdown-body hr {
  43. -moz-box-sizing: content-box;
  44. box-sizing: content-box;
  45. height: 0;
  46. }
  47. .markdown-body pre {
  48. overflow: auto;
  49. }
  50. .markdown-body code,
  51. .markdown-body kbd,
  52. .markdown-body pre {
  53. font-family: monospace, monospace;
  54. font-size: 1em;
  55. }
  56. .markdown-body input {
  57. color: inherit;
  58. font: inherit;
  59. margin: 0;
  60. }
  61. .markdown-body html input[disabled] {
  62. cursor: default;
  63. }
  64. .markdown-body input {
  65. line-height: normal;
  66. }
  67. .markdown-body input[type="checkbox"] {
  68. -moz-box-sizing: border-box;
  69. box-sizing: border-box;
  70. padding: 0;
  71. }
  72. .markdown-body table {
  73. border-collapse: collapse;
  74. border-spacing: 0;
  75. }
  76. .markdown-body td,
  77. .markdown-body th {
  78. padding: 0;
  79. }
  80. .markdown-body * {
  81. -moz-box-sizing: border-box;
  82. box-sizing: border-box;
  83. }
  84. .markdown-body input {
  85. font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  86. }
  87. .markdown-body a {
  88. color: #4183c4;
  89. text-decoration: none;
  90. }
  91. .markdown-body a:hover,
  92. .markdown-body a:focus,
  93. .markdown-body a:active {
  94. text-decoration: underline;
  95. }
  96. .markdown-body hr {
  97. height: 0;
  98. margin: 15px 0;
  99. overflow: hidden;
  100. background: transparent;
  101. border: 0;
  102. border-bottom: 1px solid #ddd;
  103. }
  104. .markdown-body hr:before {
  105. display: table;
  106. content: "";
  107. }
  108. .markdown-body hr:after {
  109. display: table;
  110. clear: both;
  111. content: "";
  112. }
  113. .markdown-body h1,
  114. .markdown-body h2,
  115. .markdown-body h3,
  116. .markdown-body h4,
  117. .markdown-body h5,
  118. .markdown-body h6 {
  119. margin-top: 15px;
  120. margin-bottom: 15px;
  121. line-height: 1.1;
  122. }
  123. .markdown-body h1 {
  124. font-size: 30px;
  125. }
  126. .markdown-body h2 {
  127. font-size: 21px;
  128. }
  129. .markdown-body h3 {
  130. font-size: 16px;
  131. }
  132. .markdown-body h4 {
  133. font-size: 14px;
  134. }
  135. .markdown-body h5 {
  136. font-size: 12px;
  137. }
  138. .markdown-body h6 {
  139. font-size: 11px;
  140. }
  141. .markdown-body blockquote {
  142. margin: 0;
  143. }
  144. .markdown-body ul,
  145. .markdown-body ol {
  146. padding: 0;
  147. margin-top: 0;
  148. margin-bottom: 0;
  149. }
  150. .markdown-body ol ol,
  151. .markdown-body ul ol {
  152. list-style-type: lower-roman;
  153. }
  154. .markdown-body ul ul ol,
  155. .markdown-body ul ol ol,
  156. .markdown-body ol ul ol,
  157. .markdown-body ol ol ol {
  158. list-style-type: lower-alpha;
  159. }
  160. .markdown-body dd {
  161. margin-left: 0;
  162. }
  163. .markdown-body code {
  164. font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
  165. }
  166. .markdown-body pre {
  167. margin-top: 0;
  168. margin-bottom: 0;
  169. font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
  170. }
  171. .markdown-body .octicon {
  172. font: normal normal 16px octicons-anchor;
  173. line-height: 1;
  174. display: inline-block;
  175. text-decoration: none;
  176. -webkit-font-smoothing: antialiased;
  177. -moz-osx-font-smoothing: grayscale;
  178. -webkit-user-select: none;
  179. -moz-user-select: none;
  180. -ms-user-select: none;
  181. user-select: none;
  182. }
  183. .markdown-body .octicon-link:before {
  184. content: '\f05c';
  185. }
  186. .markdown-body>*:first-child {
  187. margin-top: 0 !important;
  188. }
  189. .markdown-body>*:last-child {
  190. margin-bottom: 0 !important;
  191. }
  192. .markdown-body .anchor {
  193. position: absolute;
  194. top: 0;
  195. bottom: 0;
  196. left: 0;
  197. display: block;
  198. padding-right: 6px;
  199. padding-left: 30px;
  200. margin-left: -30px;
  201. }
  202. .markdown-body .anchor:focus {
  203. outline: none;
  204. }
  205. .markdown-body h1,
  206. .markdown-body h2,
  207. .markdown-body h3,
  208. .markdown-body h4,
  209. .markdown-body h5,
  210. .markdown-body h6 {
  211. position: relative;
  212. margin-top: 1em;
  213. margin-bottom: 16px;
  214. font-weight: bold;
  215. line-height: 1.4;
  216. }
  217. .markdown-body h1 .octicon-link,
  218. .markdown-body h2 .octicon-link,
  219. .markdown-body h3 .octicon-link,
  220. .markdown-body h4 .octicon-link,
  221. .markdown-body h5 .octicon-link,
  222. .markdown-body h6 .octicon-link {
  223. display: none;
  224. color: #000;
  225. vertical-align: middle;
  226. }
  227. .markdown-body h1:hover .anchor,
  228. .markdown-body h2:hover .anchor,
  229. .markdown-body h3:hover .anchor,
  230. .markdown-body h4:hover .anchor,
  231. .markdown-body h5:hover .anchor,
  232. .markdown-body h6:hover .anchor {
  233. padding-left: 8px;
  234. margin-left: -30px;
  235. line-height: 1;
  236. text-decoration: none;
  237. }
  238. .markdown-body h1:hover .anchor .octicon-link,
  239. .markdown-body h2:hover .anchor .octicon-link,
  240. .markdown-body h3:hover .anchor .octicon-link,
  241. .markdown-body h4:hover .anchor .octicon-link,
  242. .markdown-body h5:hover .anchor .octicon-link,
  243. .markdown-body h6:hover .anchor .octicon-link {
  244. display: inline-block;
  245. }
  246. .markdown-body h1 {
  247. padding-bottom: 0.3em;
  248. font-size: 2.25em;
  249. line-height: 1.2;
  250. border-bottom: 1px solid #eee;
  251. }
  252. .markdown-body h2 {
  253. padding-bottom: 0.3em;
  254. font-size: 1.75em;
  255. line-height: 1.225;
  256. border-bottom: 1px solid #eee;
  257. }
  258. .markdown-body h3 {
  259. font-size: 1.5em;
  260. line-height: 1.43;
  261. }
  262. .markdown-body h4 {
  263. font-size: 1.25em;
  264. }
  265. .markdown-body h5 {
  266. font-size: 1em;
  267. }
  268. .markdown-body h6 {
  269. font-size: 1em;
  270. color: #777;
  271. }
  272. .markdown-body p,
  273. .markdown-body blockquote,
  274. .markdown-body ul,
  275. .markdown-body ol,
  276. .markdown-body dl,
  277. .markdown-body table,
  278. .markdown-body pre {
  279. margin-top: 0;
  280. margin-bottom: 16px;
  281. }
  282. .markdown-body hr {
  283. height: 4px;
  284. padding: 0;
  285. margin: 16px 0;
  286. background-color: #e7e7e7;
  287. border: 0 none;
  288. }
  289. .markdown-body ul,
  290. .markdown-body ol {
  291. padding-left: 2em;
  292. }
  293. .markdown-body ul ul,
  294. .markdown-body ul ol,
  295. .markdown-body ol ol,
  296. .markdown-body ol ul {
  297. margin-top: 0;
  298. margin-bottom: 0;
  299. }
  300. .markdown-body li>p {
  301. margin-top: 16px;
  302. }
  303. .markdown-body dl {
  304. padding: 0;
  305. }
  306. .markdown-body dl dt {
  307. padding: 0;
  308. margin-top: 16px;
  309. font-size: 1em;
  310. font-style: italic;
  311. font-weight: bold;
  312. }
  313. .markdown-body dl dd {
  314. padding: 0 16px;
  315. margin-bottom: 16px;
  316. }
  317. .markdown-body blockquote {
  318. padding: 0 15px;
  319. color: #777;
  320. border-left: 4px solid #ddd;
  321. }
  322. .markdown-body blockquote>:first-child {
  323. margin-top: 0;
  324. }
  325. .markdown-body blockquote>:last-child {
  326. margin-bottom: 0;
  327. }
  328. .markdown-body table {
  329. display: block;
  330. width: 100%;
  331. overflow: auto;
  332. word-break: normal;
  333. word-break: keep-all;
  334. }
  335. .markdown-body table th {
  336. font-weight: bold;
  337. }
  338. .markdown-body table th,
  339. .markdown-body table td {
  340. padding: 6px 13px;
  341. border: 1px solid #ddd;
  342. }
  343. .markdown-body table tr {
  344. background-color: #fff;
  345. border-top: 1px solid #ccc;
  346. }
  347. .markdown-body table tr:nth-child(2n) {
  348. background-color: #f8f8f8;
  349. }
  350. .markdown-body img {
  351. max-width: 100%;
  352. -moz-box-sizing: border-box;
  353. box-sizing: border-box;
  354. }
  355. .markdown-body code {
  356. padding: 0;
  357. padding-top: 0.2em;
  358. padding-bottom: 0.2em;
  359. margin: 0;
  360. font-size: 85%;
  361. background-color: rgba(0,0,0,0.04);
  362. border-radius: 3px;
  363. }
  364. .markdown-body code:before,
  365. .markdown-body code:after {
  366. letter-spacing: -0.2em;
  367. content: "\00a0";
  368. }
  369. .markdown-body pre>code {
  370. padding: 0;
  371. margin: 0;
  372. font-size: 100%;
  373. word-break: normal;
  374. white-space: pre;
  375. background: transparent;
  376. border: 0;
  377. }
  378. .markdown-body .highlight {
  379. margin-bottom: 16px;
  380. }
  381. .markdown-body .highlight pre,
  382. .markdown-body pre {
  383. padding: 16px;
  384. overflow: auto;
  385. font-size: 85%;
  386. line-height: 1.45;
  387. background-color: #f7f7f7;
  388. border-radius: 3px;
  389. }
  390. .markdown-body .highlight pre {
  391. margin-bottom: 0;
  392. word-break: normal;
  393. }
  394. .markdown-body pre {
  395. word-wrap: normal;
  396. }
  397. .markdown-body pre code {
  398. display: inline;
  399. max-width: initial;
  400. padding: 0;
  401. margin: 0;
  402. overflow: initial;
  403. line-height: inherit;
  404. word-wrap: normal;
  405. background-color: transparent;
  406. border: 0;
  407. }
  408. .markdown-body pre code:before,
  409. .markdown-body pre code:after {
  410. content: normal;
  411. }
  412. .markdown-body .highlight {
  413. background: #fff;
  414. }
  415. .markdown-body .highlight .h {
  416. color: #333;
  417. font-style: normal;
  418. font-weight: normal;
  419. }
  420. .markdown-body .highlight .mf,
  421. .markdown-body .highlight .mh,
  422. .markdown-body .highlight .mi,
  423. .markdown-body .highlight .mo,
  424. .markdown-body .highlight .il,
  425. .markdown-body .highlight .m {
  426. color: #945277;
  427. }
  428. .markdown-body .highlight .s,
  429. .markdown-body .highlight .sb,
  430. .markdown-body .highlight .sc,
  431. .markdown-body .highlight .sd,
  432. .markdown-body .highlight .s2,
  433. .markdown-body .highlight .se,
  434. .markdown-body .highlight .sh,
  435. .markdown-body .highlight .si,
  436. .markdown-body .highlight .sx,
  437. .markdown-body .highlight .s1 {
  438. color: #df5000;
  439. }
  440. .markdown-body .highlight .kc,
  441. .markdown-body .highlight .kd,
  442. .markdown-body .highlight .kn,
  443. .markdown-body .highlight .kp,
  444. .markdown-body .highlight .kr,
  445. .markdown-body .highlight .kt,
  446. .markdown-body .highlight .k,
  447. .markdown-body .highlight .o {
  448. font-weight: bold;
  449. }
  450. .markdown-body .highlight .kt {
  451. color: #458;
  452. }
  453. .markdown-body .highlight .c,
  454. .markdown-body .highlight .cm,
  455. .markdown-body .highlight .c1 {
  456. color: #998;
  457. font-style: italic;
  458. }
  459. .markdown-body .highlight .cp,
  460. .markdown-body .highlight .cs,
  461. .markdown-body .highlight .cp .h {
  462. color: #999;
  463. font-weight: bold;
  464. }
  465. .markdown-body .highlight .cs {
  466. font-style: italic;
  467. }
  468. .markdown-body .highlight .n {
  469. color: #333;
  470. }
  471. .markdown-body .highlight .na,
  472. .markdown-body .highlight .nv,
  473. .markdown-body .highlight .vc,
  474. .markdown-body .highlight .vg,
  475. .markdown-body .highlight .vi {
  476. color: #008080;
  477. }
  478. .markdown-body .highlight .nb {
  479. color: #0086B3;
  480. }
  481. .markdown-body .highlight .nc {
  482. color: #458;
  483. font-weight: bold;
  484. }
  485. .markdown-body .highlight .no {
  486. color: #094e99;
  487. }
  488. .markdown-body .highlight .ni {
  489. color: #800080;
  490. }
  491. .markdown-body .highlight .ne {
  492. color: #990000;
  493. font-weight: bold;
  494. }
  495. .markdown-body .highlight .nf {
  496. color: #945277;
  497. font-weight: bold;
  498. }
  499. .markdown-body .highlight .nn {
  500. color: #555;
  501. }
  502. .markdown-body .highlight .nt {
  503. color: #000080;
  504. }
  505. .markdown-body .highlight .err {
  506. color: #a61717;
  507. background-color: #e3d2d2;
  508. }
  509. .markdown-body .highlight .gd {
  510. color: #000;
  511. background-color: #fdd;
  512. }
  513. .markdown-body .highlight .gd .x {
  514. color: #000;
  515. background-color: #faa;
  516. }
  517. .markdown-body .highlight .ge {
  518. font-style: italic;
  519. }
  520. .markdown-body .highlight .gr {
  521. color: #aa0000;
  522. }
  523. .markdown-body .highlight .gh {
  524. color: #999;
  525. }
  526. .markdown-body .highlight .gi {
  527. color: #000;
  528. background-color: #dfd;
  529. }
  530. .markdown-body .highlight .gi .x {
  531. color: #000;
  532. background-color: #afa;
  533. }
  534. .markdown-body .highlight .go {
  535. color: #888;
  536. }
  537. .markdown-body .highlight .gp {
  538. color: #555;
  539. }
  540. .markdown-body .highlight .gs {
  541. font-weight: bold;
  542. }
  543. .markdown-body .highlight .gu {
  544. color: #800080;
  545. font-weight: bold;
  546. }
  547. .markdown-body .highlight .gt {
  548. color: #aa0000;
  549. }
  550. .markdown-body .highlight .ow {
  551. font-weight: bold;
  552. }
  553. .markdown-body .highlight .w {
  554. color: #bbb;
  555. }
  556. .markdown-body .highlight .sr {
  557. color: #017936;
  558. }
  559. .markdown-body .highlight .ss {
  560. color: #8b467f;
  561. }
  562. .markdown-body .highlight .bp {
  563. color: #999;
  564. }
  565. .markdown-body .highlight .gc {
  566. color: #999;
  567. background-color: #EAF2F5;
  568. }
  569. .markdown-body kbd {
  570. background-color: #e7e7e7;
  571. background-image: -webkit-linear-gradient(#fefefe, #e7e7e7);
  572. background-image: linear-gradient(#fefefe, #e7e7e7);
  573. background-repeat: repeat-x;
  574. display: inline-block;
  575. padding: 3px 5px;
  576. font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
  577. line-height: 10px;
  578. color: #000;
  579. border: 1px solid #cfcfcf;
  580. border-radius: 2px;
  581. }
  582. .markdown-body .highlight .pl-coc,
  583. .markdown-body .highlight .pl-entm,
  584. .markdown-body .highlight .pl-eoa,
  585. .markdown-body .highlight .pl-mai .pl-sf,
  586. .markdown-body .highlight .pl-pdv,
  587. .markdown-body .highlight .pl-sc,
  588. .markdown-body .highlight .pl-sr,
  589. .markdown-body .highlight .pl-v,
  590. .markdown-body .highlight .pl-vpf {
  591. color: #0086b3;
  592. }
  593. .markdown-body .highlight .pl-eoac,
  594. .markdown-body .highlight .pl-mdht,
  595. .markdown-body .highlight .pl-mi1,
  596. .markdown-body .highlight .pl-mri,
  597. .markdown-body .highlight .pl-va,
  598. .markdown-body .highlight .pl-vpu {
  599. color: #008080;
  600. }
  601. .markdown-body .highlight .pl-c,
  602. .markdown-body .highlight .pl-pdc {
  603. color: #b4b7b4;
  604. font-style: italic;
  605. }
  606. .markdown-body .highlight .pl-k,
  607. .markdown-body .highlight .pl-ko,
  608. .markdown-body .highlight .pl-kolp,
  609. .markdown-body .highlight .pl-mc,
  610. .markdown-body .highlight .pl-mr,
  611. .markdown-body .highlight .pl-ms,
  612. .markdown-body .highlight .pl-s,
  613. .markdown-body .highlight .pl-sok,
  614. .markdown-body .highlight .pl-st {
  615. color: #6e5494;
  616. }
  617. .markdown-body .highlight .pl-ef,
  618. .markdown-body .highlight .pl-enf,
  619. .markdown-body .highlight .pl-enm,
  620. .markdown-body .highlight .pl-entc,
  621. .markdown-body .highlight .pl-eoi,
  622. .markdown-body .highlight .pl-sf,
  623. .markdown-body .highlight .pl-smc {
  624. color: #d12089;
  625. }
  626. .markdown-body .highlight .pl-ens,
  627. .markdown-body .highlight .pl-eoai,
  628. .markdown-body .highlight .pl-kos,
  629. .markdown-body .highlight .pl-mh .pl-pdh,
  630. .markdown-body .highlight .pl-mp,
  631. .markdown-body .highlight .pl-pde,
  632. .markdown-body .highlight .pl-stp {
  633. color: #458;
  634. }
  635. .markdown-body .highlight .pl-enti {
  636. color: #d12089;
  637. font-weight: bold;
  638. }
  639. .markdown-body .highlight .pl-cce,
  640. .markdown-body .highlight .pl-enc,
  641. .markdown-body .highlight .pl-kou,
  642. .markdown-body .highlight .pl-mq {
  643. color: #f93;
  644. }
  645. .markdown-body .highlight .pl-mp1 .pl-sf {
  646. color: #458;
  647. font-weight: bold;
  648. }
  649. .markdown-body .highlight .pl-cos,
  650. .markdown-body .highlight .pl-ent,
  651. .markdown-body .highlight .pl-md,
  652. .markdown-body .highlight .pl-mdhf,
  653. .markdown-body .highlight .pl-ml,
  654. .markdown-body .highlight .pl-pdc1,
  655. .markdown-body .highlight .pl-pds,
  656. .markdown-body .highlight .pl-s1,
  657. .markdown-body .highlight .pl-scp,
  658. .markdown-body .highlight .pl-sol {
  659. color: #df5000;
  660. }
  661. .markdown-body .highlight .pl-c1,
  662. .markdown-body .highlight .pl-cn,
  663. .markdown-body .highlight .pl-pse,
  664. .markdown-body .highlight .pl-pse .pl-s2,
  665. .markdown-body .highlight .pl-vi {
  666. color: #a31515;
  667. }
  668. .markdown-body .highlight .pl-mb,
  669. .markdown-body .highlight .pl-pdb {
  670. color: #df5000;
  671. font-weight: bold;
  672. }
  673. .markdown-body .highlight .pl-mi,
  674. .markdown-body .highlight .pl-pdi {
  675. color: #6e5494;
  676. font-style: italic;
  677. }
  678. .markdown-body .highlight .pl-ms1 {
  679. background-color: #f5f5f5;
  680. }
  681. .markdown-body .highlight .pl-mdh,
  682. .markdown-body .highlight .pl-mdi {
  683. font-weight: bold;
  684. }
  685. .markdown-body .highlight .pl-mdr {
  686. color: #0086b3;
  687. font-weight: bold;
  688. }
  689. .markdown-body .highlight .pl-s2 {
  690. color: #333;
  691. }
  692. .markdown-body .highlight .pl-ii {
  693. background-color: #df5000;
  694. color: #fff;
  695. }
  696. .markdown-body .highlight .pl-ib {
  697. background-color: #f93;
  698. }
  699. .markdown-body .highlight .pl-id {
  700. background-color: #a31515;
  701. color: #fff;
  702. }
  703. .markdown-body .highlight .pl-iu {
  704. background-color: #b4b7b4;
  705. }
  706. .markdown-body .highlight .pl-mo {
  707. color: #969896;
  708. }
  709. .markdown-body .task-list-item {
  710. list-style-type: none;
  711. }
  712. .markdown-body .task-list-item+.task-list-item {
  713. margin-top: 3px;
  714. }
  715. .markdown-body .task-list-item input {
  716. float: left;
  717. margin: 0.3em 0 0.25em -1.6em;
  718. vertical-align: middle;
  719. }</style><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  720. <script>
  721. MathJax.Hub.Config({
  722. config: ["MMLorHTML.js"],
  723. extensions: ["tex2jax.js"],
  724. jax: ["input/TeX"],
  725. tex2jax: {
  726. inlineMath: [ ['$','$'], ["\\(","\\)"] ],
  727. displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
  728. processEscapes: false
  729. },
  730. TeX: {
  731. extensions: ["AMSmath.js", "AMSsymbols.js"],
  732. TagSide: "right",
  733. TagIndent: ".8em",
  734. MultLineWidth: "85%",
  735. equationNumbers: {
  736. autoNumber: "AMS",
  737. },
  738. unicode: {
  739. fonts: "STIXGeneral,'Arial Unicode MS'"
  740. }
  741. },
  742. showProcessingMessages: false
  743. });
  744. </script>
  745. <title>classesBasket</title></head><body><article class="markdown-body"><p><a href="#markdown-header-classes-basket">English</a> | <a href="#markdown-header-clases-baloncesto">Español</a></p>
  746. <h1>
  747. <a id="user-content-clases---baloncesto" class="anchor" href="#clases---baloncesto" aria-hidden="true"><span class="octicon octicon-link"></span></a>Clases - Baloncesto</h1>
  748. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main1.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main1.png" alt="main1.png" style="max-width:100%;"></a>
  749. <a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main2.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main2.png" alt="main2.png" style="max-width:100%;"></a>
  750. <a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main3.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main3.png" alt="main3.png" style="max-width:100%;"></a></p>
  751. <p>La <em>programación orientada a objetos</em> (object oriented programming, OOP) es un paradigma de programación que promueve el diseño de programas en el que distintos objetos interactúan entre sí para resolver un problema. C++ es uno de los lenguajes de programación que promueve la programación orientada a objetos, permitiendo que los programadores creen sus propias clases desde cero o derivadas de otras clases existentes. Algunos otros lenguajes que promueven OOP son Java, Python, javascript y PHP. </p>
  752. <p>En OOP, cada objeto encapsula dentro de él ciertas propiedades sobre el ente que está modelando (por ejemplo, un objeto que modela un <em>punto</em> encapsula dentro de sí las coordenadas <em>x</em> y <em>y</em> del punto que representa). Además, cada objeto permite realizar ciertas acciones sobre sí, i.e. contiene sus <em>métodos</em>. Por ejemplo, un objeto de clase <em>punto</em> puede realizar la acción de cambiar el valor de su coordenada <em>x</em>. </p>
  753. <p>Cuando la clase de objetos que necesitamos utilizar en nuestro programa no ha sido predefinida en el alguna librería, necesitamos declarar e implementar nuestra propia clase. Para esto definimos <em>clases</em> que contengan datos con ciertas <em>propiedades</em> o <em>atributos</em> y acciones que queremos hacer con esos datos por medio de <em>métodos</em> o <em>funciones miembro</em>. De esta manera, podremos organizar la información y procesos en <em>objetos</em> que tienen las propiedades y métodos de una clase. En la experiencia de laboratorio de hoy practicarás el definir una clase e implementar algunos de sus métodos completando un programa que simula un partido de baloncesto entre dos jugadores, mantiene la puntuación del juego y las estadísticas globales de los dos jugadores.</p>
  754. <h2>
  755. <a id="user-content-objetivos" class="anchor" href="#objetivos" aria-hidden="true"><span class="octicon octicon-link"></span></a>Objetivos:</h2>
  756. <ol>
  757. <li><p>Diseñar y definir una clase.</p></li>
  758. <li><p>Implementar métodos de una clase.</p></li>
  759. </ol>
  760. <h2>
  761. <a id="user-content-pre-lab" class="anchor" href="#pre-lab" aria-hidden="true"><span class="octicon octicon-link"></span></a>Pre-Lab:</h2>
  762. <p>Antes de llegar al laboratorio debes haber:</p>
  763. <ol>
  764. <li><p>Repasado los conceptos relacionados a clases y objetos.</p></li>
  765. <li><p>Estudiado el esqueleto del programa en <code>main.cpp</code>.</p></li>
  766. <li><p>Estudiado los conceptos e instrucciones para la sesión de laboratorio.</p></li>
  767. <li><p>Tomado el quiz Pre-Lab que se encuentra en Moodle.</p></li>
  768. </ol>
  769. <hr>
  770. <hr>
  771. <h2>
  772. <a id="user-content-el-juego" class="anchor" href="#el-juego" aria-hidden="true"><span class="octicon octicon-link"></span></a>El juego</h2>
  773. <p>El esqueleto de programa que te proveemos simula un partido de baloncesto entre dos jugadores. Todos los tiros anotados reciben dos puntos. Se inicializan los datos con el nombre de cada jugador y sus estadísticas globales en el "torneo": total de juegos jugados, tiros intentados, tiros anotados y rebotes. El programa incluye funciones aleatorias y fórmulas para determinar el jugador que intenta el tiro, si anota el tiro y el jugador que coge el rebote. Durante el partido simulado se mantiene la puntuación de cada jugador y se actualizan los datos para cada jugador. Al final del partido se despliega una tabla con las estadísticas.</p>
  774. <hr>
  775. <h3>
  776. <a id="user-content-la-clase-bbplayer" class="anchor" href="#la-clase-bbplayer" aria-hidden="true"><span class="octicon octicon-link"></span></a>La clase <code>BBPlayer</code>
  777. </h3>
  778. <p>Para esta experiencia de laboratorio, definirás una clase <code>BBPlayer</code> que contenga los atributos y métodos que se describen abajo. Como algunas de las funciones que ya están definidas en el código provisto utilizan atributos y métodos de esta clase, es importante que utilices los mismos nombres que te indicamos. El código comentado en la función <code>main</code> y en <code>test_BBPlayer</code> también te ayudará a determinar el tipo de dato que debe devolver el método y los tipos que deben tener los parámetros y el orden en que se incluyen en la declaración de la función.</p>
  779. <h4>
  780. <a id="user-content-atributos" class="anchor" href="#atributos" aria-hidden="true"><span class="octicon octicon-link"></span></a>Atributos</h4>
  781. <ul>
  782. <li> <code>_name</code>: guardará el nombre del jugador</li>
  783. <li> <code>_shotsTaken</code>: guardará el número de tiros al canasto intentados durante el torneo</li>
  784. <li> <code>_shotsMade</code>: guardará el número de tiros al canasto anotados durante el torneo</li>
  785. <li> <code>_gamesPlayed</code>: guardará el número de juegos jugados durante el torneo</li>
  786. <li> <code>_rebounds</code>: guardará el número de rebotes durante el torneo</li>
  787. <li> <code>_score</code>: guardará la puntuación del jugador durante el partido</li>
  788. </ul>
  789. <h4>
  790. <a id="user-content-métodos" class="anchor" href="#m%C3%A9todos" aria-hidden="true"><span class="octicon octicon-link"></span></a>Métodos</h4>
  791. <ul>
  792. <li>constructor por defecto (default). <em>(método incluido en <code>main.cpp</code>)</em>
  793. </li>
  794. <li>
  795. <code>setAll()</code>: método que asignará valor inicial a todos los atributos de un objeto. Nota que este método está invocado al comienzo de <code>main</code> para asignarle valores iniciales al arreglo <code>P</code> que es un arreglo de dos objetos de la clase <code>BBPlayer</code>.</li>
  796. <li>
  797. <code>name()</code>: método para adquirir el nombre del jugador.</li>
  798. <li>
  799. <code>shotPercentage()</code>: método para calcular el porciento de tiros anotados; se usa para "determinar" si el tiro intentado por un jugador se anota. <em>(método incluido en <code>main.cpp</code>)</em>
  800. </li>
  801. <li>
  802. <code>reboundsPerGame()</code>: método para calcular el promedio de rebotes cogidos por juego; se usa para "determinar" si un jugador coge un rebote. <em>(método incluido en <code>main.cpp</code>)</em>
  803. </li>
  804. <li>
  805. <code>shotMade()</code>: método que registra que se anotó un tiro, que se intentó un tiro, y actualiza la puntuación del jugador.</li>
  806. <li>
  807. <code>shotMissed()</code>: método que registra tiro intentado (pero fallado).</li>
  808. <li>
  809. <code>reboundMade()</code>: método que registra un rebote cogido.</li>
  810. <li>
  811. <code>addGame()</code>: método que registra que se jugó un partido.</li>
  812. <li>
  813. <code>score()</code>: método para adquirir la puntuación del jugador.</li>
  814. <li>
  815. <code>printStats()</code>: método para desplegar las estádisticas del jugador. <em>(método incluido en <code>main.cpp</code>)</em>
  816. </li>
  817. </ul>
  818. <hr>
  819. <hr>
  820. <h2>
  821. <a id="user-content-sesión-de-laboratorio" class="anchor" href="#sesi%C3%B3n-de-laboratorio" aria-hidden="true"><span class="octicon octicon-link"></span></a>Sesión de laboratorio:</h2>
  822. <p>Tu tarea durante la sesión de laboratorio será el definir la clase <code>BBPlayer</code> con los atributos y prototipos de los métodos que se listan arriba. El esqueleto del programa incluye el código para definir algunos de los métodos; otros tendrán que ser definidos.</p>
  823. <p>El esqueleto del programa también incluye la función <code>test_BBPlayer</code> que hace pruebas unitarias a cada una de las funciones del programa. Las pruebas están comentadas y, según vayas definiendo las funciones, las vas descomentando, probando y modificando la función hasta que la prueba para esa función se pase. Una vez todas las funciones estén listas y hayan pasado las pruebas, se prueba el programa completo removiendo los comentarios que sean necesarios en el código de la función <code>main</code>.</p>
  824. <h3>
  825. <a id="user-content-ejercicio-0-bajar-y-entender-el-código-provisto" class="anchor" href="#ejercicio-0-bajar-y-entender-el-c%C3%B3digo-provisto" aria-hidden="true"><span class="octicon octicon-link"></span></a>Ejercicio 0: Bajar y entender el código provisto</h3>
  826. <h4>
  827. <a id="user-content-instrucciones" class="anchor" href="#instrucciones" aria-hidden="true"><span class="octicon octicon-link"></span></a>Instrucciones</h4>
  828. <ol>
  829. <li><p>Carga a QtCreator el proyecto <code>basket01</code> haciendo doble "click" en el archivo <code>basket01.pro</code> en el directorio <code>Documents/eip/Classes-Basket</code> de tu computadora. También puedes ir a <code>http://bitbucket.org/eip-uprrp/classes-basket</code> para descargar la carpeta <code>Classes-Basket</code> a tu computadora.</p></li>
  830. <li><p>Este programa correrá en el terminal y debes seleccionar esa opción desde la ventana de "Projects". Para acceder a esta ventana, seleccionas "Projects" en el menú vertical de la izquierda. Luego en <code>Build &amp; Run</code> seleccionas <code>Run</code> y luego marcas la caja que dice <code>Run in terminal</code>.</p></li>
  831. <li><p>Estudia y entiende el código en el archivo <code>main.cpp</code>, incluyendo el código que está comentado.</p></li>
  832. </ol>
  833. <h3>
  834. <a id="user-content-ejercicio-1-definir-la-clase-bbplayer" class="anchor" href="#ejercicio-1-definir-la-clase-bbplayer" aria-hidden="true"><span class="octicon octicon-link"></span></a>Ejercicio 1: Definir la clase <code>BBPlayer</code>
  835. </h3>
  836. <ol>
  837. <li>
  838. <p>Define la clase <code>BBPlayer</code> con las especificaciones que se incluyen arriba. Para cada uno de los métodos que se especifican arriba:</p>
  839. <p>a. Incluye el prototipo del método en la definición de la clase</p>
  840. <p>b. Si la función correspondiente a ese método ya está codificada en el programa, remueve los comentarios de las secciones correspondientes a esa función en <code>test_BBPlayer</code>.</p>
  841. <p>c. Si la función correspondiente a ese método no está codificada, define la función y luego remueve los comentarios de las secciones correspondientes a esa función en <code>test_BBPlayer</code>.</p>
  842. <p>d. Corre el programa y verifica que haya pasado las pruebas. Debes obtener una ventana similar a la de la Figura 1. Si no pasa las pruebas, revisa tu código. Repite hasta que tu código haya pasado las pruebas. </p>
  843. <hr>
  844. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure1.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure1.png" alt="figure1.png" style="max-width:100%;"></a></p>
  845. <p><strong>Figura 1.</strong> Ejemplo de la pantalla que debes obtener si el código pasa las pruebas unitarias.</p>
  846. <hr>
  847. </li>
  848. <li>
  849. <p>Una vez tengas todas las funciones definidas y probadas, descomenta el código de la función <code>main</code> para probar el programa completo. Si el programa funciona correctamente, debes obtener una ventana que comienza de manera similar a la Figura 2 y termina como en la Figura 3.</p>
  850. <hr>
  851. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure2.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure2.png" alt="figure2.png" style="max-width:100%;"></a></p>
  852. <p><strong>Figura 2.</strong> Ejemplo del comienzo de la pantalla que debes obtener si el programa funciona correctamente.</p>
  853. <hr>
  854. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure3.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure3.png" alt="figure3.png" style="max-width:100%;"></a></p>
  855. <p><strong>Figura 3.</strong> Ejemplo de la pantalla que debes obtener al final del programa si éste funciona correctamente.</p>
  856. <hr>
  857. </li>
  858. </ol>
  859. <p><strong>IMPORTANTE:</strong> NO debes hacer ningún cambio en las funciones <code>main</code> y <code>test_BBPlayer</code>, aparte de quitar los comentarios.</p>
  860. <hr>
  861. <hr>
  862. <h2>
  863. <a id="user-content-entrega" class="anchor" href="#entrega" aria-hidden="true"><span class="octicon octicon-link"></span></a>Entrega</h2>
  864. <p>Utiliza "Entrega" en Moodle para entregar el archivo <code>main.cpp</code>. Recuerda utilizar buenas prácticas de programación, incluir el nombre de los programadores y documentar tu programa.</p>
  865. <hr>
  866. <hr>
  867. <h2>
  868. <a id="user-content-referencias" class="anchor" href="#referencias" aria-hidden="true"><span class="octicon octicon-link"></span></a>Referencias</h2>
  869. <p>[1] <a href="http://www.telegraph.co.uk/sport/olympics/basketball/9348826/London-2012-Olympics-Temi-Fagbenle-in-Team-GB-womens-basketball-squad.html">http://www.telegraph.co.uk/sport/olympics/basketball/9348826/London-2012-Olympics-Temi-Fagbenle-in-Team-GB-womens-basketball-squad.html</a></p>
  870. <p>[2] <a href="http://www.musthavemenus.com/category/bar-clipart.html">http://www.musthavemenus.com/category/bar-clipart.html</a></p>
  871. <p>[3] <a href="http://basketball.isport.com/basketball-guides/finding-your-niche-in-basketball">http://basketball.isport.com/basketball-guides/finding-your-niche-in-basketball</a></p>
  872. <hr>
  873. <hr>
  874. <hr>
  875. <p><a href="#markdown-header-classes-basket">English</a> | <a href="#markdown-header-clases-baloncesto">Español</a></p>
  876. <h1>
  877. <a id="user-content-classes---basketball" class="anchor" href="#classes---basketball" aria-hidden="true"><span class="octicon octicon-link"></span></a>Classes - Basketball</h1>
  878. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main1.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main1.png" alt="main1.png" style="max-width:100%;"></a>
  879. <a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main2.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main2.png" alt="main2.png" style="max-width:100%;"></a>
  880. <a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main3.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/main3.png" alt="main3.png" style="max-width:100%;"></a></p>
  881. <p><em>Object Oriented Programming</em> (OOP) is a programming paradigm that promotes the design of programs by having different objects interacting together to solve a problem. C++ is one of the programming languages that promotes object oriented programming, allowing programmers to create their own classes from scratch or derive them from other existing classes. Other languages that promote OOP are Java, Python, Javascript and PHP.</p>
  882. <p>In OOP, each object encapsulates within itself certain properties about the entity being modeled (for example, an object that models a <em>point</em> encapsulates the coordinates <em>x</em> and <em>y</em> of the point being represented). Furthermore, each object allows certain actions to be carried out on itself with the <em>methods</em> that the object contains. For example, an object of class <em>point</em> could carry out the action of changing the value of the <em>x</em> coordinate.</p>
  883. <p>When an object class we need to use in our program has not been predefined in a library, we need to declare and implement our own class. To do this, we define <em>classes</em> that contain data with certain <em>properties</em> or <em>attributes</em> and actions that we want to carry out with this data through the use of <em>methods</em> or <em>member functions</em>. This way, we can organize the information and processes in <em>objects</em> that have the properties and methods of a class. In today's laboratory experience you will practice defining a class and implementing some of its methods by completing a program that simulates a basketball game between two players, maintaining the score for the game and the global statistics for the two players.</p>
  884. <h2>
  885. <a id="user-content-objectives" class="anchor" href="#objectives" aria-hidden="true"><span class="octicon octicon-link"></span></a>Objectives:</h2>
  886. <ol>
  887. <li><p>Design and define a class.</p></li>
  888. <li><p>Implement methods for a class.</p></li>
  889. </ol>
  890. <h2>
  891. <a id="user-content-pre-lab-1" class="anchor" href="#pre-lab-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>Pre-Lab:</h2>
  892. <p>Before coming to the laboratory you should have:</p>
  893. <ol>
  894. <li><p>Reviewed the concepts related to classes and objects.</p></li>
  895. <li><p>Studied the skeleton for the program in <code>main.cpp</code>.</p></li>
  896. <li><p>Studied the concepts and instructions for the laboratory session.</p></li>
  897. <li><p>Taken the Pre-Lab quiz that can be found in Moodle.</p></li>
  898. </ol>
  899. <hr>
  900. <hr>
  901. <h2>
  902. <a id="user-content-the-game" class="anchor" href="#the-game" aria-hidden="true"><span class="octicon octicon-link"></span></a>The Game</h2>
  903. <p>The skeleton for the program that we provide simulates a basketball game between two players. The successful throws into the basket receive two points. The data is initiated with the name of each player and the global statistics in the "tournament": total of games played, attempted throws, successful throws and rebounds. The program includes random functions and formulas to determine the player that attempts a throw, if the player scores, and the player that takes the rebound. During the simulated game the score for each player is kept and each player's data is updated. At the end of the game, a table with the statistics is displayed.</p>
  904. <hr>
  905. <h3>
  906. <a id="user-content-the-bbplayer-class" class="anchor" href="#the-bbplayer-class" aria-hidden="true"><span class="octicon octicon-link"></span></a>The <code>BBPlayer</code> Class</h3>
  907. <p>For this laboratory experience, you will define the <code>BBPlayer</code> class that contains the attributes and methods that are described below. Since some of the functions that are already defined in the provided code use attributes and methods of this class, it is important that you use the same names that we indicate. The commented code in the <code>main</code> function and in <code>test_BBPlayer</code> will help you determine the type of data the method should return, the types the parameters should have, and the order in which they are included in the function declaration.</p>
  908. <h4>
  909. <a id="user-content-attributes" class="anchor" href="#attributes" aria-hidden="true"><span class="octicon octicon-link"></span></a>Attributes</h4>
  910. <ul>
  911. <li>
  912. <code>_name</code>: stores the name of the player</li>
  913. <li>
  914. <code>_shotsTaken</code>: stores the number of attempted throws during the tournament</li>
  915. <li>
  916. <code>_showsMade</code>: stores the number of throws scored during the tournament</li>
  917. <li>
  918. <code>_gamesPlayed</code>: stores the number of games played during the tournament</li>
  919. <li>
  920. <code>_rebounds</code>: stores the number of rebounds during the tournament</li>
  921. <li>
  922. <code>_score</code>: stores the player's score during the game</li>
  923. </ul>
  924. <h4>
  925. <a id="user-content-methods" class="anchor" href="#methods" aria-hidden="true"><span class="octicon octicon-link"></span></a>Methods</h4>
  926. <ul>
  927. <li>default constructor. <em>(method included in <code>main.cpp</code>)</em>
  928. </li>
  929. <li>
  930. <code>setAll()</code>: methods that assigns an initial value to all of the attributes of the object. Notice that this method is invoked at the beginning of <code>main</code> to assign initial values to the array <code>P</code> that is an array of two objects of the <code>BBPlayer</code> class.</li>
  931. <li>
  932. <code>name()</code>: method to acquire the name of the player.</li>
  933. <li>
  934. <code>shotPercentage()</code>: method to compute the percent of throws scored; is used to determine if the attempted throw is scored by a player. <em>(method included in <code>main.cpp</code>)</em>
  935. </li>
  936. <li>
  937. <code>reboundsPerGame()</code>: method to compute the average number of rebounds caught by a player; is used to determine if the player successfully catches the rebound. <em>(method included in <code>main.cpp</code>)</em>
  938. </li>
  939. <li>'shotMade()': method that registers that a shot was scored, that a shot was attempted, and updates the score for the player.</li>
  940. <li>
  941. <code>shotMissed()</code>: method that registers an attempted throw (but unsuccessful).</li>
  942. <li>
  943. <code>reboundMade()</code>: method that registers that a rebound was caught.</li>
  944. <li>
  945. <code>addGame()</code>: method that registers that a game was played.</li>
  946. <li>
  947. <code>score()</code>: method to acquire the score of a player.</li>
  948. <li>
  949. <code>printStats()</code>: method that displays a player's statistics. <em>(method included in <code>main.cpp</code>)</em>
  950. </li>
  951. </ul>
  952. <hr>
  953. <hr>
  954. <h2>
  955. <a id="user-content-laboratory-session" class="anchor" href="#laboratory-session" aria-hidden="true"><span class="octicon octicon-link"></span></a>Laboratory Session:</h2>
  956. <p>During this laboratory session, your task will be to define the <code>BBPlayer</code> class with the attributes and method prototypes listed above. The skeleton for the program includes the code to define some of the methods; others will have to be defined.</p>
  957. <p>The skeleton for the program also includes the <code>test_BBPlayer</code> function that does unit tests to each of the functions in the program. The tests are commented and, as you define each function, you will remove the comment, test and modify the function, until the test for that function is passed. Once all of the functions are ready and have passed the tests, the whole program is tested by removing the necessary comments in the <code>main</code> function.</p>
  958. <h3>
  959. <a id="user-content-exercise-0-download-and-understand-the-provided-code" class="anchor" href="#exercise-0-download-and-understand-the-provided-code" aria-hidden="true"><span class="octicon octicon-link"></span></a>Exercise 0: Download and understand the provided code</h3>
  960. <h4>
  961. <a id="user-content-instructions" class="anchor" href="#instructions" aria-hidden="true"><span class="octicon octicon-link"></span></a>Instructions</h4>
  962. <ol>
  963. <li><p>Load the <code>basket01</code> project onto Qt by double clicking on the <code>basket01.pro</code> filein the directory <code>Documents/eip/Classes-Basket</code> of your computer. You may also go to <code>http://bitbucket.org/eip-uprrp/classes-basket</code> to download the <code>Classes-Basket</code> folder to your computer.</p></li>
  964. <li><p>This program will run on the terminal and you should select this option from the "Projects" window. To access this window, you select "Projects" in the vertical menu to the left. Afterwards, in <code>Build &amp; Run</code> you select <code>Run</code> and then mark the box that says <code>Run in terminal</code>.</p></li>
  965. <li><p>Study and understand the code in the <code>main.cpp</code> file, including the code that is commented.</p></li>
  966. </ol>
  967. <h3>
  968. <a id="user-content-exercise-1-define-the-bbplayer-class" class="anchor" href="#exercise-1-define-the-bbplayer-class" aria-hidden="true"><span class="octicon octicon-link"></span></a>Exercise 1: Define the <code>BBPlayer</code> class</h3>
  969. <ol>
  970. <li>
  971. <p>Define the <code>BBPlayer</code> class with the specifications included above. For each one of the methods that are specified above:</p>
  972. <p>a. Include a prototype for the method in the class definition.</p>
  973. <p>b. If the corresponding member function is already coded in the program, remove the comments from the corresponding sections for this function in <code>test_BBPlayer</code>.</p>
  974. <p>c. If the corresponding member function is not coded, define the function and then remove the comments from the corresponding sections for this function in <code>test_BBPlayer</code>.</p>
  975. <p>d. Run the program and verify that it passed all of the tests. You should obtain a window similar to the one in Figure 1. If your code does not pass all the tests, revise your code. Repeat until your code has passed all of the tests.</p>
  976. <hr>
  977. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure1.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure1.png" alt="figure1.png" style="max-width:100%;"></a></p>
  978. <p><strong>Figure 1.</strong> Example of the window you should obtain if the code passes the unit tests.</p>
  979. <hr>
  980. </li>
  981. <li>
  982. <p>Once you have all of the functions defined and tested, uncomment the code in the <code>main</code> function to test the whole program. If the program functions correctly, you should obtain a window that starts similarly to the one in Figure 2 and finishes like the one in Figure 3.</p>
  983. <hr>
  984. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure2.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure2.png" alt="figure2.png" style="max-width:100%;"></a></p>
  985. <p><strong>Figure 2.</strong> Example of the start of the window you should obtain if the program functions correctly.</p>
  986. <hr>
  987. <p><a href="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure3.png" target="_blank"><img src="/Users/Ivelisse/Dropbox/eip/EIP-REVISION-VERANO/Classes/Basket/basket-Edited-WithSolution-Aug-2015/images/figure3.png" alt="figure3.png" style="max-width:100%;"></a></p>
  988. <p><strong>Figure 3.</strong> Example of the window you should obtain at the end of the program if it is working correctly.</p>
  989. <hr>
  990. </li>
  991. </ol>
  992. <p><strong>IMPORTANT:</strong> You SHOULD NOT make any changes in the <code>main</code> and <code>test_BBPlayer</code> functions, aside from removing the comments.</p>
  993. <hr>
  994. <hr>
  995. <h2>
  996. <a id="user-content-deliverables" class="anchor" href="#deliverables" aria-hidden="true"><span class="octicon octicon-link"></span></a>Deliverables</h2>
  997. <p>Use "Deliverables" in Moodle to hand in the <code>main.cpp</code> file. Remember to use good programming techniques, include the name of the programmers involved, and document your program.</p>
  998. <hr>
  999. <hr>
  1000. <h2>
  1001. <a id="user-content-references" class="anchor" href="#references" aria-hidden="true"><span class="octicon octicon-link"></span></a>References</h2>
  1002. <p>[1] <a href="http://www.telegraph.co.uk/sport/olympics/basketball/9348826/London-2012-Olympics-Temi-Fagbenle-in-Team-GB-womens-basketball-squad.html">http://www.telegraph.co.uk/sport/olympics/basketball/9348826/London-2012-Olympics-Temi-Fagbenle-in-Team-GB-womens-basketball-squad.html</a></p>
  1003. <p>[2] <a href="http://www.musthavemenus.com/category/bar-clipart.html">http://www.musthavemenus.com/category/bar-clipart.html</a></p>
  1004. <p>[3] <a href="http://basketball.isport.com/basketball-guides/finding-your-niche-in-basketball">http://basketball.isport.com/basketball-guides/finding-your-niche-in-basketball</a></p>
  1005. </article></body></html>