Difference between revisions of "Sum Distances To Origin With Functions Assignment"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
=Code To Implement= | =Code To Implement= | ||
==sum_distances_to_origin== | ==sum_distances_to_origin== | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{SMLToImplement|sum_distances_to_origin|sum_distances_to_origin|warmup_sum_distances_to_origin_fun}} | {{SMLToImplement|sum_distances_to_origin|sum_distances_to_origin|warmup_sum_distances_to_origin_fun}} | ||
Revision as of 21:22, 26 August 2024
Background
The distance of a point (x,y) from the origin:
Basis Library
Code To Implement
sum_distances_to_origin
file: | src/main/sml/warmup_sum_distances_to_origin_fun/sum_distances_to_origin.sml | ![]() |
functions: | sum_distances_to_origin |
fun sum_distances_to_origin(xys : (real * real) list)
Test
source folder: | src/test/sml/warmup_sum_distances_to_origin_fun |
how to run with CM.make verbosity off: | sml -Ccm.verbose=false run_sum_distances_to_origin_fun_testing.sml |
how to run with CM.make verbosity on: | sml run_sum_distances_to_origin_fun_testing.sml |
note: ensure that you have removed all printing to receive credit for any assignment.