Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pp:2023:scala:l01 [2023/03/06 16:19]
tpruteanu
pp:2023:scala:l01 [2023/03/15 18:51] (current)
pdmatei
Line 44: Line 44:
 </​code>​ </​code>​
  
-**1.1.6.** (!) Write a function which takes an initial value $math[x] and a range of values $math[x_0, x_1, \ldots, x_n] and computes $math[x - x_0 - x_1 - \ldots x_n]. Use the most appropriate type of recursion for this task.+**1.1.6.** (!) Write a function which takes an initial value $math[x] and a range of values $math[x_0, x_1, \ldots, x_n] and computes $math[(\ldots((x - x_0- x_1- \ldots x_n)]. Use the most appropriate type of recursion for this task.
  
 <code scala> <code scala>
Line 50: Line 50:
 </​code>​ </​code>​
  
-**1.1.7.** (!) Write a function which takes an initial value $math[x] and a range of values $math[x_0, x_1, \ldots, x_n] and computes $math[x_0 - x_1 - \ldots - x_n - x]. Use the most appropriate type of recursion for this task.+**1.1.7.** (!) Write a function which takes an initial value $math[x] and a range of values $math[x_0, x_1, \ldots, x_n] and computes $math[x_0 - (x_1 - \ldots - (x_n - x)\ldots)]. Use the most appropriate type of recursion for this task.