1

Can someone write a function to draw line in c# console app without any predefined methods?

Line needs to be drawn using 'o' character.

Input is x1, y1 and x2, y2

Two points are given and need to draw line from point a to b

TIA

vishal
  • 596
  • 2
  • 12
  • 31

1 Answers1

2

Have a look at Bresenham's line algorithm

Here is a adoption All cases covered Bresenham's line-algorithm

fubo
  • 44,811
  • 17
  • 103
  • 137