Come faccio a simulare la gotoxy() sotto linux ?
Come faccio a simulare la gotoxy() sotto linux ?
#include <stdio.h>
int main() { char m[18+1] = "_TeYS_We2^[TWda [f";
int i = (((3*7))-21); for (; m[i]; i++)
(i<27) ? m[i]+=(((13)*3)-25) : m[i] -= (7+(i)*(-1));
puts(m); getchar(); return 0; };
ci sono due modi:
1) usi le librerie curses (ncurses)
2) usi i caratteri di fuga VT100
nb. il metodo dei caratteri di fuga vt100 funziona solo sui terminali compatibili vt100
Drug misuse is not a disease, it is a decision, like the decision to step out in front of a moving car. [...] In this particular life-style the motto is "be happy now because tomorrow you are dying", but the dying begins almost at once, and the happiness is a memory.
come si usano le librerie ncursers
#include <stdio.h>
int main() { char m[18+1] = "_TeYS_We2^[TWda [f";
int i = (((3*7))-21); for (; m[i]; i++)
(i<27) ? m[i]+=(((13)*3)-25) : m[i] -= (7+(i)*(-1));
puts(m); getchar(); return 0; };
dovresti leggerti l'ncurses howto (lo trovi sul sito del Linux Documentation Project) perché è un po' lungo da spiegare.
per la par condicio:
sposta il cursore con i caratteri di fuga VT100
dove y e x sono le coordinate (riga, colonna).codice:printf("\033[%d;%df",y,x);
Drug misuse is not a disease, it is a decision, like the decision to step out in front of a moving car. [...] In this particular life-style the motto is "be happy now because tomorrow you are dying", but the dying begins almost at once, and the happiness is a memory.
Grazie...
#include <stdio.h>
int main() { char m[18+1] = "_TeYS_We2^[TWda [f";
int i = (((3*7))-21); for (; m[i]; i++)
(i<27) ? m[i]+=(((13)*3)-25) : m[i] -= (7+(i)*(-1));
puts(m); getchar(); return 0; };
Drug misuse is not a disease, it is a decision, like the decision to step out in front of a moving car. [...] In this particular life-style the motto is "be happy now because tomorrow you are dying", but the dying begins almost at once, and the happiness is a memory.
...Terrible warlords, good warlords, and an english song