Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 3 Constraints
#1
The task 3 specs forbid local defines, except for functions. Does this mean that we are forbidden from defining args in main?

It's easy to get around this with a lambda that is immediately called, but that seems a little unnecessary.
Reply
#2
(09-07-2017, 09:21 PM)evtilley Wrote: The task 3 specs forbid local defines, except for functions. Does this mean that we are forbidden from defining args in main?

It's easy to get around this with a lambda that is immediately called, but that seems a little unnecessary.

You can define a function in main which takes in a set of arguments. Within that function, you can define a function which takes in the result of resistance and t and applies the result and t to the three color functions (and prints them).
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
#3
defining pi in the mred, mgreen, mblue  allowed?
Reply
#4
(09-08-2017, 12:49 AM)mmrahman Wrote: defining pi in the mred, mgreen, mblue  allowed?

Quote:Constraints: You are only allowed the following top-level functions: main, resistance, mred, mgreen, and mblue. They must be defined in the order given. The only local definitions allowed are functions definitions.

Sounds like you could define pi at the top level, as it's not a function.
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
#5
^ correct
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)