Sunday, September 27, 2009

io_display in one line

This does not fully work.
It's a success against cases where strlen(str) > len and len <= 0.
However when strlen(str) < len it fills up the remaining field with all but one space (eg. if str is "abc" and len is 6, it would only print "abc" plus 2 spaces). I've given up on it, at least for tonight.

for (io_move(row, col), len<=0 ? len=strlen(str) : len; len > 0; len--, *str++) {
len>0 && *str=='\0' ? io_putch(' ') : io_putch(*str);
}

No comments:

Post a Comment