Tetris clone in C++. API includes game system and logic backend. There is also a text based frontend (disp) method to display the game state. However you will have to implement input handling and whatnot yourself.
Guidelines are roughly based on these - https://tetris.wiki/Tetris_Guideline. The method for the AI system is based on this article - https://luckytoilet.wordpress.com/2011/05/27/coding-a-tetris-ai-using-a-genetic-algorithm/.