I need to draw 10 lines. From one point along one line to 10 other points. Using the ncurses library it would be desirable to find a solution using this library, I write under Linux in C ++.

I am writing a small toy. 10 on 10 "Archers". I need to draw an animation of a shot, so to speak, for starters, I would just like a line from one archer to another.

  • Well, googled in half a second: the Brezenham algorithm . There's even ready-made code and animated picture available ... - PinkTux
  • I have this option, but I would like something to Water LineTo from the Windows.h library - Rodion the Great
  • What a lazy programmer went ... There scribbling on 10 lines. Write and name Line(int x0, int y0, int x1, int y1) , for a couple of minutes. And in their own library, they still have only horizontal and vertical lines, if on the sclerocol. - PinkTux
  • What are you speaking about? I did not quite understand you. - Rodion the Great
  • one
    Uh ... You do not understand how, having 10 lines of the finished algorithm and the ncurses library before your eyes, write your function for drawing a line? Prompts. Put the cursor in the desired position - the function move(int x, int y) , display the character - addch(const chtype ch) . - PinkTux

0