task 2
This commit is contained in:
parent
e33f77b46e
commit
16e6e51472
@ -6,8 +6,14 @@ package imagefilters
|
|||||||
object ImageFilters {
|
object ImageFilters {
|
||||||
|
|
||||||
def duplicate(a: Array[Array[Int]]): Array[Array[Int]] = {
|
def duplicate(a: Array[Array[Int]]): Array[Array[Int]] = {
|
||||||
|
val height: Int = a.length
|
||||||
/* TODO: Write your code hereunder */
|
val width: Int = if (height == 0) 0 else a(0).length
|
||||||
return Array.empty
|
val res: Array[Array[Int]] = Array.ofDim(height, width)
|
||||||
|
for (y: Int <- 0 until height) {
|
||||||
|
for (x: Int <- 0 until width) {
|
||||||
|
res(y)(x) = a(y)(x)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user