cmdline simulation in console, in C language