Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
fp2025:lab03 [2025/03/12 15:40]
pdmatei
fp2025:lab03 [2026/03/23 11:31] (current)
silviu
Line 47: Line 47:
 </​code>​ </​code>​
  
-**3.8.** We define ''​Line2D''​ to be lines in a 2-dimensional space, and we represent them as functions. Write a function which takes a Line2D and translates it up on the Ox axis by a given offset. For instance, translateOx of 2 on y=x+1 will return y=x+3.+**3.8.** We define ''​Line2D''​ to be lines in a 2-dimensional space, and we represent them as functions. Write a function which takes a Line2D and translates it up on the Ox axis by a given offset. For instance, translateOx of 2 on y=2*x+1 will return y=2*x-3.
 <code scala> <code scala>
 type Line2D = Int => Int type Line2D = Int => Int