I made my first normal console game in C ++ here. This is a simple game. The game is also known as Concentration, Pelmanism, Shinkei-suijaku, Pexeso and Pairs. This is a simple console implementation of this game. There are 3 levels: easy, normal and difficult. Also after the game, statistics are displayed (for how many moves you completed the level).

I tried to use STL and object-oriented programming. Therefore, first of all, I would like to know how to improve in this. I would also like to know how clean and clear my code is. I would be very grateful for all the tips!

Github link

Closed due to the fact that the essence of the question is incomprehensible by the participants nick_n_a , cheops , Kromster , Jarvis_J , Kosta B. 11 Jul '18 at 17:58 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • I advise you to use curses for such games - this is a good solution for developing a console game interface. - Andrej Levkovitch
  • during the game it is impossible to get out of it. I advise you to make C ^ d a signal to the exit - this is quite a standard console solution - Andrej Levkovitch
  • If you press the esc key and enter when the prog asks for input - some kind of endless cycle starts - check this - Andrej Levkovitch
  • @AndrejLevkovitch, I did not understand about C ^ d, for example ^ C works. And at the expense of output, but did not think through) - Mark Starikov
  • @AndrejLevkovitch could not repeat the problem with Esc + Enter. (Win 7) - Mark Starikov

1 answer 1

This Sunday I was confused and wrote my version of this game. Input-output through curses , works under Linux and Windows, though with regard to the latter - I do not guarantee that you can build under it, so the link to the compiled program is next to it. The version is not final, it is a work reserve - I wrote it so that the program could be modified to the maximum by changing only constants (such as the size of the deck, the number of cards, their size, etc.)

github

compiled program under windows

  • Interesting to see! - Mark Starikov
  • one
    @ Mark Starikov can offer a joint revision of this code to the level of a full-fledged game. If you are interested - Andrej Levkovitch
  • Yes interesting. Can do. - Mark Starikov
  • @ Mark Starikov then I'll give you access to the repository - Andrej Levkovitch
  • ok, accept, where we will discuss the project? Slack, Telegram, Viber? - Mark Starikov