Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 6 Compare Results
#1
Test file:

Code:
#!/bin/bash
echo "(define (f x y z) (+ x (* y z)))" > task6.args
echo "(2)" >> task6.args
echo "(1 2)" >> task6.args
echo "(3)" >> task6.args
scam -r task6.scm task6.args > results.text
echo "(define (f x y z) (+ x (* y z)))" > task6.args
echo "(1)" >> task6.args
echo "(1)" >> task6.args
echo "(2 3)" >> task6.args
scam -r task6.scm task6.args >> results.text
echo "(define (f x y z) (+ x (* y z)))" > task6.args
echo "(3)" >> task6.args
echo "(1 2 3)" >> task6.args
echo "()" >> task6.args
scam -r task6.scm task6.args >> results.text
echo "(define (f x y z) (- x y (* z z)))" > task6.args
echo "(3)" >> task6.args
echo "(1 2 3)" >> task6.args
echo "()" >> task6.args
scam -r task6.scm task6.args >> results.text
echo "(define (f x y z) (- x y (* z z)))" > task6.args
echo "(1)" >> task6.args
echo "(1)" >> task6.args
echo "(2 3)" >> task6.args
scam -r task6.scm task6.args >> results.text
echo "(define (f x y z) (- x y (* z z)))" > task6.args
echo "(2)" >> task6.args
echo "(1 2)" >> task6.args
echo "(3)" >> task6.args
scam -r task6.scm task6.args >> results.text

My results:

Code:
(length (get (quote parameters) f1)) is 2
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 1
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 3
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 3
(length (get (quote parameters) f2)) is 1
-10
(length (get (quote parameters) f1)) is 1
(length (get (quote parameters) f2)) is 1
-10
(length (get (quote parameters) f1)) is 2
(length (get (quote parameters) f2)) is 1
-10
UA ACM Vice President
ACM has bi-weekly meetings Tuesdays at 5:15pm
We're UA's best organization for CS majors (website)
Join us on Slack for all kinds of discussion channels (including one for CS403)
Reply
#2
I get the same overall results, but different parameter counts for f2 on some cases:

Code:
(length (get (quote parameters) f1)) is 2
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 1
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 3
(length (get (quote parameters) f2)) is 1
7
(length (get (quote parameters) f1)) is 3
(length (get (quote parameters) f2)) is 1
-10
(length (get (quote parameters) f1)) is 1
(length (get (quote parameters) f2)) is 1
-10
(length (get (quote parameters) f1)) is 2
(length (get (quote parameters) f2)) is 1
-10
Reply
#3
I get the same as evtilley
Reply
#4
Updated my results after fixing my program. Same as evtilley now.
UA ACM Vice President
ACM has bi-weekly meetings Tuesdays at 5:15pm
We're UA's best organization for CS majors (website)
Join us on Slack for all kinds of discussion channels (including one for CS403)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)