mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-02-21 12:29:05 +00:00
Messing around with lambda functions.
This commit is contained in:
parent
0f8dbaba4a
commit
8c46ccc34d
Binary file not shown.
@ -58,15 +58,19 @@ word = @_displayItemStats, @_displayItemName
|
||||
|
||||
// Other global variables here
|
||||
|
||||
def travFind2(pObj, val, func)
|
||||
word ret
|
||||
while pObj
|
||||
val, ret = func(val, pObj)#2
|
||||
if ret; return pObj; fin
|
||||
pObj = pObj=>p_nextObj
|
||||
loop
|
||||
return NULL
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
def itemByNum(player, num)#1
|
||||
word item
|
||||
item = player=>p_items
|
||||
while num
|
||||
item = item=>p_nextObj
|
||||
num--
|
||||
loop
|
||||
return item
|
||||
return travFind2(player=>p_items, num, &(n,p)(n-1, n==0))
|
||||
end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user