Source Code File 15-02_steps

15-02_steps.c

#include <ncurses.h>
    
int main()
{   
    int y,x,maxy,maxx;
    
    initscr();

    getmaxyx(stdscr,maxy,maxx);
    
    for(y=x=0;y<maxy;y++,x+=2)
    {
        move(y,x);
        hline(0,maxx-x);
        vline(0,maxy-y);
    }
    refresh();
    getch();

    endwin();
    return(0);
}

Output Screenshot

Notes

* The output may look funky if the terminal window isn't set exactly to its preset size. For example, if the window is set to 57 rows of 132 columns, ensure that it's that exact size when the program runs. Otherwise, the results won't look like the screenshot above.