edited tests and made changes to triangle.c

Implementation passes John’s perl script.