Share your repls and programming experiences

← Back to all posts
Snake in C++.
Arabica (8)

This snake using C & C++ and only using the standard library!

Comments
hotnewtop
DynamicSquid (4636)

Nice! But why doesn't the program just stop and wait for the user to press a key? I don't see any threads here...

Arabica (8)

@DynamicSquid
termios.h I believe.
It might be setting up threads.

ANDREWVOSS (40)

@DynamicSquid I think it's because the code uses getch instead of the usual getchar. (getch has no buffer)

DynamicSquid (4636)

@ANDREWVOSS Oh, interesting, never knew that

ANDREWVOSS (40)

@DynamicSquid Nvm, conio.h isn't included and getch is declared elsewhere.

Arabica (8)

@ANDREWVOSS conio.h is not apart of the standard library.