|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <!DOCTYPE html>
- <html>
- <meta charset="utf-8">
- <head>
- <link rel="stylesheet" href="../../style.css">
- </head>
- <body>
- <script data-goatcounter="https://services.opengamestudio.org:443/count" async src="//services.opengamestudio.org:443/count.js"></script>
- <div id="header">
- <div class="header2">
- <div class="menu">
- <a href="../../en/news/index.html">News</a>
- <a href="../../en/game/index.html">Games</a>
- <a href="../../en/tool/index.html">Tools</a>
- <a href="../../en/page/about.html">About</a>
- </div>
- <div id="lang">
- <a href="../../en/news/memory-text-ui.html">EN</a>
- <a href="../../ru/news/memory-text-ui.html">RU</a>
- </div>
- <div class="clear"></div>
- </div>
- </div>
- <h3 class="left_item_title">In the news...</h3>
- <center>
- <div class="news_item">
- <h2 class="news_item_title">
- <a href="memory-text-ui.html">"Memory" text UI</a>
- </h2>
- <p class="news_item_date">
- 2024-06-14 00:00
- </p>
- <div class="news_item_contents">
- <h1 id="memorytextui">"Memory" text UI</h1>
- <p>In May I implemented text UI for "Memory" game in Python. And converted it to C++
- by the instrument under development.</p>
- <p>Game logic cycle implementation lead to the creation of a controller that manages
- context. Creating the controller in Python was straightforward. C++ version took
- 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.
- The instrument under development is limited to C++11 in order to support OpenWrt.</p>
- <p>Here's how much code I wrote (in lines):</p>
- <ul>
- <li>(Python) Portable logic code: 360</li>
- <li>(Python) Portable testing code: 565</li>
- <li>(Python) Unportable code of controller, input/output, etc.: 350</li>
- <li>(C++) Ported logic code: 360</li>
- <li>(C++) Ported testing code: 586</li>
- <li>(C++) Unportable code of controller, input/output, etc.: 565</li>
- </ul>
- <p>Here's the same data in per cent:</p>
- <table>
- <thead>
- <tr>
- <th>Language</th>
- <th>Total lines of code</th>
- <th>Portable/ported</th>
- <th>Unportable</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Python</td>
- <td>1275 (<strong>100%</strong>)</td>
- <td>925 (<strong>72%</strong>)</td>
- <td>350 (<strong>28%</strong>)</td>
- </tr>
- <tr>
- <td>C++</td>
- <td>1511 (<strong>100%</strong>)</td>
- <td>946 (<strong>62%</strong>)</td>
- <td>565 (<strong>38%</strong>)</td>
- </tr>
- </tbody>
- </table>
- <p>Thus, the development of C++ version of "Memory" game was 62% lines
- of code cheaper than if it would be without the instrument. Nice figures.</p>
- <p>Here's how "Memory" text UI looks like now:</p>
- <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>
- <h1 id="juneplans">June plans</h1>
- <p>I'll make a graphical UI for Python version of "Memory" game.</p>
- </div>
- </div>
- <div id="disqus_thread"></div>
- <script>
- var disqus_config = function () {
- this.page.url = "https://opengamestudio.org/en/news/memory-text-ui.html";
- this.page.identifier = "memory-text-ui.html";
- };
- (function() { // DON'T EDIT BELOW THIS LINE
- var d = document, s = d.createElement('script');
- s.src = 'https://opengamestudio.disqus.com/embed.js';
- s.setAttribute('data-timestamp', +new Date());
- (d.head || d.body).appendChild(s);
- })();
- </script>
- <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- <div id="footer">
- The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
- from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
- </div>
- </center>
- </body>
- </html>
|