Testing("Binary searching")

9 views
Skip to first unread message

Kyle Johnson

unread,
Jun 21, 2019, 9:09:54 AM6/21/19
to mathpiper-dev
I am unable to find BSearch.mpws anywhere besides in scripts storage.

The path to get to the file is: mathpiperide\src\library_apps\mathpiper4\storage\scriptsstorage\lists\BSearch.mpws

For the test that is located in lists_tests.mpws where should I move this test to?

The automatic grading fold that is in question is:

/* todo:tk:commenting out for minimal version of the scripts.
Testing("Binary searching");
Verify(BSearch(100,[[n],n^2-15]), -1);
Verify(BSearch(100,[[n],n^2-16]), 4);
Verify(BSearch(100,[[n],n^2-100002]), -1);
Verify(BSearch(100,[[n],n^2-0]), -1);
Verify(FindIsq(100,[[n],n^2-15]), 3);
Verify(FindIsq(100,[[n],n^2-16]), 4);
Verify(FindIsq(100,[[n],n^2-100002]), 100);
Verify(FindIsq(100,[[n],n^2-0]), 1);
*/

Any help is appreciated!

Ted Kosan

unread,
Jun 21, 2019, 11:00:40 AM6/21/19
to mathpi...@googlegroups.com
Kyle,

I forked MathPiper from the Yacas CAS project in 2008, and then I
spent years changing the syntax of the language to be more suitable
for use in education. Since I was only using a subset of the
procedures that came with Yacas, I placed ones I was not using into
the "storage" directory so I had less code to change as the syntax
changes were being performed. "BSearch" is one of the procedures that
was put into storage. This is why the tests for this procedure are
commented-out. Go ahead and leave these commented-out tests in
"lists_tests.mpws" for now. The "todo" that is in the comment will be
enough to flag them as needing to be attended to in the future.

By the way, I think most of the syntax changes have been completed.
This means that future tasks may involve moving procedures out of
"storage" and into "scripts4" so they are available for use again.

Ted
> --
> You received this message because you are subscribed to the Google Groups "mathpiper-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mathpiper-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mathpiper-dev/5c7c655c-36e0-43f8-8458-ed9403695920%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kyle Johnson

unread,
Jun 27, 2019, 10:30:00 PM6/27/19
to mathpiper-dev
All of the tests that were located in lists_tests.mpws have now been moved into each file that it refers to excluding BSearch. 

Was just wanting to give an update!
> To unsubscribe from this group and stop receiving emails from it, send an email to mathpi...@googlegroups.com.

Ted Kosan

unread,
Jun 27, 2019, 10:42:40 PM6/27/19
to mathpi...@googlegroups.com
Kyle,

Locate "BSearch.mpws" in the "storage" directory by doing the
following search in NetBeans:

"BSearch

This technique is useful for locating the definition of a procedure
because it finds its use in a "def" attribute and ignores is possible
uses in the code.

Copy the commented-out "BSearch" tests that are in "lists_tests.mpws"
to the "BSearch.mpws" file that is in storage, then delete
"lists_tests.mpws" from the repository :-)

Ted
> To unsubscribe from this group and stop receiving emails from it, send an email to mathpiper-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mathpiper-dev/74242f12-4b22-44cf-be3b-1da6bb8419f3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages