Closed am-cid closed 4 months ago
chan[3]
chan[2]
chan[4]
dimension()
Int
replace(arg1, arg2)
nuww
first(n)
n
a-chan[] = {1,2,3,4}~ pwint(a.first(2))~ >.< prints {1,2}
n <= 0
chan[3].first(2)
last(n)
a-chan[] = {1,2,3,4}~ pwint(a.last(2))~ >.< prints {3,4}
chan[3].last(2)
shift()
pop()
chan[3].shift()
ShiftError
chan[3].pop()
PopError
definition of terms
chan[3]
's unit type ischan[2]
chan[3]
's array type ischan[4]
new
dimension()
Int
describing the dimension of the arrayreplace(arg1, arg2)
nuww
first(n)
Int
n
n <= 0
chan[3].first(2)
, it will return achan[3]
with <=2 elementslast(n)
Int
n
n <= 0
chan[3].last(2)
, it will return achan[3]
with <=2 elementsshift()
pop()
but for the first element instead of the last elementchan[3].shift()
, it will return achan[2]
shift()
an empty array, it will raise aShiftError
. in uwu terms, it will cause a runtime errorchange
pop()
chan[3].pop()
, it will return achan[2]
pop()
an empty array, it will raise aPopError
. in uwu terms, it will cause a runtime error