0

I would like to make something like Snake, Tetris or Pacman as a console aplication.

I want to make my program wait a small amount of time for user input before it goes back to doing whatever it is doing.

Take Tetris for example. I want the aplication to wait a second for one or more keystrokes and make the coresponding adjustments before the blocks move one square lower.

Is there a way to do that in c?

  • [Multithreading](http://stackoverflow.com/questions/3908031/how-to-multithread-c-code) can be a solution. BTW it is too broad as stated now. – LPs May 15 '17 at 08:24
  • You might found what you want in this answer ; http://stackoverflow.com/a/28526162/4834199 – bttX May 15 '17 at 08:26
  • Keep in mind that if you have only thread, waiting for an input will stop your program from doing other things – Badda May 15 '17 at 08:29
  • @PaulR Yes, that's exactly what I was looking for. Thanks! – Suppy Five May 15 '17 at 08:29
  • Previous comment got deleted - the question that @SuppyFive is referring to is http://stackoverflow.com/questions/33945266/keep-executing-loop-while-potentially-taking-input/33945372#33945372 but it's not one of the flagged duplicates as it does not have an accepted answer. – Paul R May 15 '17 at 08:34

0 Answers0