commit 0bfa1defb4ef9f44a4948606072714b7d8d7e252
parent 155dfb66a092a77584dcced14296b538bbee5110
Author: Christos Margiolis <christos@margiolis.net>
Date: Sun, 8 Mar 2020 03:22:22 +0200
added expression display
Diffstat:
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -19,6 +19,5 @@ A simple ncurses graph generator.
* Add the option to give a function while in the program
* Add coordinates using cursor pointing
* *(Perhaps)* add derivative calculator
-* Display expression
* Fix axes plotting bug
* Add point numbering on axes
diff --git a/bin/graphcurses b/bin/graphcurses
Binary files differ.
diff --git a/obj/main.o b/obj/main.o
Binary files differ.
diff --git a/src/main.cpp b/src/main.cpp
@@ -167,6 +167,10 @@ int main(int argc, char **argv)
{
erase();
attron(COLOR_PAIR(1));
+ attron(A_BOLD);
+ if (argv[1] != nullptr) printw("f(x) = %s", ((std::string)argv[1]).c_str());
+ else printw("f(x) = sin(x)");
+ attroff(A_BOLD);
handle_key(key, plane);
draw_axes(plane);
attroff(COLOR_PAIR(1));