You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 4 месеца
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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>
  11. <strong id="title">Open Game Studio</strong>
  12. <div id="lang">
  13. <a href="../../en/news/memory-text-ui.html">EN</a>
  14. <a href="../../ru/news/memory-text-ui.html">RU</a>
  15. </div>
  16. </div>
  17. <div class="header2">
  18. <div class="menu">
  19. <a href="../../en/news/index.html">News</a>
  20. <a href="../../en/game/index.html">Games</a>
  21. <a href="../../en/tool/index.html">Tools</a>
  22. <a href="../../en/page/about.html">About</a>
  23. </div>
  24. <a class="discord" href="https://t.me/Tail_and_shadow">
  25. <img src="../../images/telegram.png"></img>
  26. </a>
  27. <div class="clear"></div>
  28. </div>
  29. </div>
  30. <h3 class="left_item_title">In the news...</h3>
  31. <center>
  32. <div class="news_item">
  33. <h2 class="news_item_title">
  34. <a href="memory-text-ui.html">"Memory" text UI</a>
  35. </h2>
  36. <p class="news_item_date">
  37. 2024-06-14 00:00
  38. </p>
  39. <div class="news_item_contents">
  40. <h1 id="memorytextui">"Memory" text UI</h1>
  41. <p>In May I implemented text UI for "Memory" game in Python. And converted it to C++
  42. by the instrument under development.</p>
  43. <p>Game logic cycle implementation lead to the creation of a controller that manages
  44. context. Creating the controller in Python was straightforward. C++ version took
  45. 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.
  46. The instrument under development is limited to C++11 in order to support OpenWrt.</p>
  47. <p>Here's how much code I wrote (in lines):</p>
  48. <ul>
  49. <li>(Python) Portable logic code: 360</li>
  50. <li>(Python) Portable testing code: 565</li>
  51. <li>(Python) Unportable code of controller, input/output, etc.: 350</li>
  52. <li>(C++) Ported logic code: 360</li>
  53. <li>(C++) Ported testing code: 586</li>
  54. <li>(C++) Unportable code of controller, input/output, etc.: 565</li>
  55. </ul>
  56. <p>Here's the same data in per cent:</p>
  57. <table>
  58. <thead>
  59. <tr>
  60. <th>Language</th>
  61. <th>Total lines of code</th>
  62. <th>Portable/ported</th>
  63. <th>Unportable</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <tr>
  68. <td>Python</td>
  69. <td>1275 (<strong>100%</strong>)</td>
  70. <td>925 (<strong>72%</strong>)</td>
  71. <td>350 (<strong>28%</strong>)</td>
  72. </tr>
  73. <tr>
  74. <td>C++</td>
  75. <td>1511 (<strong>100%</strong>)</td>
  76. <td>946 (<strong>62%</strong>)</td>
  77. <td>565 (<strong>38%</strong>)</td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. <p>Thus, the development of C++ version of "Memory" game was 62% lines
  82. of code cheaper than if it would be without the instrument. Nice figures.</p>
  83. <p>Here's how "Memory" text UI looks like now:</p>
  84. <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>
  85. <h1 id="juneplans">June plans</h1>
  86. <p>I'll make a graphical UI for Python version of "Memory" game.</p>
  87. </div>
  88. </div>
  89. <div id="disqus_thread"></div>
  90. <script>
  91. var disqus_config = function () {
  92. this.page.url = "https://opengamestudio.org/en/news/memory-text-ui.html";
  93. this.page.identifier = "memory-text-ui.html";
  94. };
  95. (function() { // DON'T EDIT BELOW THIS LINE
  96. var d = document, s = d.createElement('script');
  97. s.src = 'https://opengamestudio.disqus.com/embed.js';
  98. s.setAttribute('data-timestamp', +new Date());
  99. (d.head || d.body).appendChild(s);
  100. })();
  101. </script>
  102. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  103. <div id="footer">
  104. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  105. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  106. </div>
  107. </center>
  108. </body>
  109. </html>