Add help examples

This commit is contained in:
Diogo Cordeiro 2018-12-20 23:19:22 +00:00
parent f9d579c494
commit f12221bed0
1 changed files with 17 additions and 12 deletions

View File

@ -138,20 +138,24 @@ do_process_input(help_menu) :-
writeln("Furthermore, I'm capable of memorizing polynomials during runtime. To learn more on that, type: tell me about storage"). writeln("Furthermore, I'm capable of memorizing polynomials during runtime. To learn more on that, type: tell me about storage").
do_process_input(help(show)) :- do_process_input(help(show)) :-
writeln("It's almost an echo of what you said, but a mathy one."), writeln("It's almost an echo of what you said, but a mathy one."),
writeln("Some example queries:"), writeln("Example query:"),
writeln(">"). writeln("> show two plus x squared"),
writeln("2+x^2").
do_process_input(help(multiply)) :- do_process_input(help(multiply)) :-
writeln("Multiplies a polynomial represented as an expression by a scalar resulting in a second polynomial. The two first arguments are assumed to be ground. The polynomial resulting from the sum is in simplified form."), writeln("Multiplies a polynomial represented as an expression by a scalar resulting in a second polynomial. The two first arguments are assumed to be ground. The polynomial resulting from the sum is in simplified form."),
writeln("Some example queries:"), writeln("Example query:"),
writeln(">"). writeln("> multiply three by two plus x squared"),
writeln("3*x^2+6").
do_process_input(help(simplify)) :- do_process_input(help(simplify)) :-
writeln("Simplifies a polynomial represented as an expression as another polynomial as an expression."), writeln("Simplifies a polynomial represented as an expression as another polynomial as an expression."),
writeln("Some example queries:"), writeln("Example query:"),
writeln(">"). writeln("> simplify two plus two plus one times y"),
writeln("y+4").
do_process_input(help(add)) :- do_process_input(help(add)) :-
writeln("Adds two polynomials as expressions resulting in a third one. The two first arguments are assumed to be ground. The polynomial resulting from the sum is in simplified form."), writeln("Adds two polynomials as expressions resulting in a third one. The two first arguments are assumed to be ground. The polynomial resulting from the sum is in simplified form."),
writeln("Some example queries:"), writeln("Some example queries:"),
writeln(">"). writeln("> add two times x to four times x"),
writeln("6*x").
do_process_input(help(storage)) :- do_process_input(help(storage)) :-
writeln("Polynomials, pressed between the entries of my storage"), writeln("Polynomials, pressed between the entries of my storage"),
writeln("Polynomials, simplified through the ages just like predicates"), writeln("Polynomials, simplified through the ages just like predicates"),
@ -163,13 +167,14 @@ do_process_input(help(storage)) :-
nl, nl,
writeln("Storage manipulation is better illustrated with examples. Some example queries:"), writeln("Storage manipulation is better illustrated with examples. Some example queries:"),
writeln("Asking me to memorize something:"), writeln("Asking me to memorize something:"),
writeln(">"), writeln("> show two plus x squared as P1"),
writeln("P1 = 2+x^2"),
writeln("> multiply three by P1 as P2"),
writeln("P2 = 3*x^2+6"),
nl, nl,
writeln("Asking me to forget something:"), writeln("Asking me to forget something:"),
writeln(">"), writeln("> forget P1 and show stored polynomials"),
nl, writeln("P2 = 6+3*x^2").
writeln("Some examples of memory resources usage:"),
writeln(">").
do_process_input(help(bye)) :- do_process_input(help(bye)) :-
writeln("There must be some kind of way outta here"), writeln("There must be some kind of way outta here"),
writeln("Said the joker to the thief"), writeln("Said the joker to the thief"),