Title: “Memory” text UI Date: 2024-06-14 00:00 Category: News Slug: memory-text-ui Lang: en
In May I implemented text UI for “Memory” game in Python. And converted it to C++ by the instrument under development.
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 std::any, which is part of C++17. The instrument under development is limited to C++11 in order to support OpenWrt.
Here's how much code I wrote (in lines):
Here's the same data in per cent:
Language | Total lines of code | Portable/ported | Unportable |
---|---|---|---|
Python | 1275 (100%) | 925 (72%) | 350 (28%) |
C++ | 1511 (100%) | 946 (62%) | 565 (38%) |
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.
Here's how “Memory” text UI looks like now:
I'll make a graphical UI for Python version of “Memory” game.