mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-07-12 02:29:00 +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
|
// 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
|
def itemByNum(player, num)#1
|
||||||
word item
|
return travFind2(player=>p_items, num, &(n,p)(n-1, n==0))
|
||||||
item = player=>p_items
|
|
||||||
while num
|
|
||||||
item = item=>p_nextObj
|
|
||||||
num--
|
|
||||||
loop
|
|
||||||
return item
|
|
||||||
end
|
end
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user