--- a/robots/flush_in.c +++ b/robots/flush_in.c @@ -47,5 +47,5 @@ void flush_in() { - tcflush(fileno(stdin), TCIFLUSH); + flushinp(); /* fredygames.com: no tty */ } --- a/robots/move.c +++ b/robots/move.c @@ -97,10 +97,10 @@ refresh(); } } else - c = getchar(); + c = getch(); /* fredygames.com: keys come from the page */ if (isdigit(c)) { Count = (c - '0'); - while (isdigit(c = getchar())) + while (isdigit(c = getch())) Count = Count * 10 + (c - '0'); if (c == ESC) goto over; --- a/robots/query.c +++ b/robots/query.c @@ -56,7 +56,7 @@ addstr(prompt); clrtoeol(); refresh(); - retval = ((c = getchar()) == 'y' || c == 'Y'); + retval = ((c = getch()) == 'y' || c == 'Y'); move(Y_PROMPT, X_PROMPT); clrtoeol(); move(y, x); --- a/robots/score.c +++ b/robots/score.c @@ -197,7 +197,13 @@ if ((pp = getpwuid(scp->s_uid)) == NULL) pp->pw_name = unknown; +#ifdef __EMSCRIPTEN__ + /* fredygames.com: one player per browser */ + (void)pp; + strncpy(scp->s_name, "player", MAXNAME); +#else strncpy(scp->s_name, pp->pw_name, MAXNAME); +#endif } /*