#include #include extern "C" { #include "term0.h" } using namespace std; int main() { term0_construct("192.168.66.96", 9266); const unsigned xmax = term0_xmax(); unsigned x = 0; term0_put(x, 'X'); char c = term0_get(x); term0_put(x + 1, c); term0_puts(2, "Type printable chars ending w/ q."); for (x = 0; x < xmax; ++x %= xmax) { //x = x + 1, x = x % xmax while ((c = term0_key()) == '\0') { } if (c == 'q') { //quit goto done; } term0_put(x, c); } done:; term0_wait(3000); //three seconds term0_beep(); term0_destruct(); return EXIT_SUCCESS; }