r/reviewmycode • u/VillageHopeful6645 • Jul 17 '25
C++ [C++] - ncurses Pacman game
Hi everyone, I made this PacMan game using c++ and the ncurses tui library. I would really appreciate it if someone could look it over and give me some feedback. My goal is to put it on my resume when applying for jobs.
https://github.com/woodrowb96/ncurses-pacman
This is the git repository for the project.
Thanks, I really appreciate the help.
8
Upvotes
2
u/skeeto Jul 18 '25
Fun little game. The arcade flashing effect is a nice touch. Issues I noticed:
getchuntil there's no more input.There are are several input loops, and only one of them sleep. The others look like this
This pegs a CPU core at 100%, which isn't a nice experience. Either put
getchin blocking mode or at least limit the frame rate like during the game.I noticed this
O(n*m)that could instead beO(n+m):Same with
operator!=. Though at least these appear to be unused. (Though whystd::listinstead ofstd::vector?std::listis niche and rarely needed.)std::listpassed by copy instead of reference, so there's a quite a bit of unnecessary copying.