1. Line drawing
- Posted by alrobnett Jan 01, 2019
- 1232 views
Thanks to a lot of help, my binary tree program is now working very nicely. It may be guilding the lily, (and is certainly unnecessary), but the display would be easier for others to understand if there were diagonal lines drawn on the screen between various points. I have done manual searches for:
lines
draw lines
drawing
graphics
Do I need some kind of C functions to do this? I used them successfully years ago.
2. Re: Line drawing
- Posted by ChrisB (moderator) Jan 01, 2019
- 1290 views
Hi
Assuming you are using text mode, you kind of have to make them up using what you have.
Youc should have a program in the demo folder of your eu installation called ascii.exu - run this and see what you can use from there. See http://www.asciitable.com/
Note, you can plece these characters on your screen using puts(1, 193), where 193 represents the ascii character you want to output.
If you want more intricate line drawing then you have to use an older version of eu which changed the consoles mode to allow point and line drawing, or use one of the graphics libraries (sdl or Allegro) to draw it and output text to the right places.
Hope this helps
Cheers
Chris
3. Re: Line drawing
- Posted by alrobnett Jan 01, 2019
- 1223 views
Thanks, Chris. The truth is that long horizontal lines (series of underscores) and short vertical lines (|) will probably work at least as well.
4. Re: Line drawing
- Posted by irv Jan 01, 2019
- 1266 views
You may be able to do what you want with existing characters: look, for example, for a program called Character Map on your computer, and choose Greek script. It has characters like these: 𝈼 𝈻 𝈺 𝈩 𝈪 𝈫 which could be put together to give you some connecting lines. Be sure your gnome-terminal is set to UTF-8 under the Compatibility tab so it can display these.
To get the characters into your program, just copy and paste with the mouse.
5. Re: Line drawing
- Posted by alrobnett Jan 02, 2019
- 1173 views
Uh-huh!
Thanks. Position and puts of underlines and vertical bars has served very well.