Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

memory-text-ui.html 4.4KB

2 månader sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <link rel="stylesheet" href="../../style.css">
  6. </head>
  7. <body>
  8. <script data-goatcounter="https://services.opengamestudio.org:443/count" async src="//services.opengamestudio.org:443/count.js"></script>
  9. <div id="header">
  10. <div class="header2">
  11. <div class="menu">
  12. <a href="../../en/news/index.html">News</a>
  13. <a href="../../en/game/index.html">Games</a>
  14. <a href="../../en/tool/index.html">Tools</a>
  15. <a href="../../en/page/about.html">About</a>
  16. </div>
  17. <div id="lang">
  18. <a href="../../en/news/memory-text-ui.html">EN</a>
  19. <a href="../../ru/news/memory-text-ui.html">RU</a>
  20. </div>
  21. <div class="clear"></div>
  22. </div>
  23. </div>
  24. <h3 class="left_item_title">In the news...</h3>
  25. <center>
  26. <div class="news_item">
  27. <h2 class="news_item_title">
  28. <a href="memory-text-ui.html">"Memory" text UI</a>
  29. </h2>
  30. <p class="news_item_date">
  31. 2024-06-14 00:00
  32. </p>
  33. <div class="news_item_contents">
  34. <h1 id="memorytextui">"Memory" text UI</h1>
  35. <p>In May I implemented text UI for "Memory" game in Python. And converted it to C++
  36. by the instrument under development.</p>
  37. <p>Game logic cycle implementation lead to the creation of a controller that manages
  38. context. Creating the controller in Python was straightforward. C++ version took
  39. some time, because the controller needs <a href="https://en.cppreference.com/w/cpp/utility/any">std::any</a>, which is part of C++17.
  40. The instrument under development is limited to C++11 in order to support OpenWrt.</p>
  41. <p>Here's how much code I wrote (in lines):</p>
  42. <ul>
  43. <li>(Python) Portable logic code: 360</li>
  44. <li>(Python) Portable testing code: 565</li>
  45. <li>(Python) Unportable code of controller, input/output, etc.: 350</li>
  46. <li>(C++) Ported logic code: 360</li>
  47. <li>(C++) Ported testing code: 586</li>
  48. <li>(C++) Unportable code of controller, input/output, etc.: 565</li>
  49. </ul>
  50. <p>Here's the same data in per cent:</p>
  51. <table>
  52. <thead>
  53. <tr>
  54. <th>Language</th>
  55. <th>Total lines of code</th>
  56. <th>Portable/ported</th>
  57. <th>Unportable</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <tr>
  62. <td>Python</td>
  63. <td>1275 (<strong>100%</strong>)</td>
  64. <td>925 (<strong>72%</strong>)</td>
  65. <td>350 (<strong>28%</strong>)</td>
  66. </tr>
  67. <tr>
  68. <td>C++</td>
  69. <td>1511 (<strong>100%</strong>)</td>
  70. <td>946 (<strong>62%</strong>)</td>
  71. <td>565 (<strong>38%</strong>)</td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. <p>Thus, the development of C++ version of "Memory" game was 62% lines
  76. of code cheaper than if it would be without the instrument. Nice figures.</p>
  77. <p>Here's how "Memory" text UI looks like now:</p>
  78. <iframe width="560" height="315" src="https://www.youtube.com/embed/tChSjw5W8KQ?si=WO5MYLCBhgstVshl" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  79. <h1 id="juneplans">June plans</h1>
  80. <p>I'll make a graphical UI for Python version of "Memory" game.</p>
  81. </div>
  82. </div>
  83. <div id="disqus_thread"></div>
  84. <script>
  85. var disqus_config = function () {
  86. this.page.url = "https://opengamestudio.org/en/news/memory-text-ui.html";
  87. this.page.identifier = "memory-text-ui.html";
  88. };
  89. (function() { // DON'T EDIT BELOW THIS LINE
  90. var d = document, s = d.createElement('script');
  91. s.src = 'https://opengamestudio.disqus.com/embed.js';
  92. s.setAttribute('data-timestamp', +new Date());
  93. (d.head || d.body).appendChild(s);
  94. })();
  95. </script>
  96. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  97. <div id="footer">
  98. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  99. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  100. </div>
  101. </center>
  102. </body>
  103. </html>