Hi Everyone,
i am trying to display numbers from 105 but the output should be : {105,110,115,120,,125,130,135,140,145,150,151,152,153,154,155,156,157,158,159,160,165,170,175,180,185,190,195,200},
i have tried but after 105 iam getting 115,Here sharing my code
a!localVariables( local!data: 101 + enumerate(100), index( local!data, where(like(touniformstring(local!data), "*5*")) ))
Thank You In Advance
Discussion posts and replies are publicly visible
Could you please try the below code.
a!localVariables( local!data: 101 + enumerate(100), index( local!data, (enumerate(count(local!data)/5)+1)*5, {} ) )
its only showing those are divided by 5 i want to show that but as well after 150 i want to show 151,152,153,154,155,156,157,158,159 like this then after 160 again 165,170
Something like below?
a!localVariables( local!data: 101 + enumerate(100), local!indexesContains5: wherecontains(true(), find(5, local!data, 1) > 1), local!multipleOf5: (enumerate(count(local!data) / 5) + 1) * 5, sortintegerarray( index( local!data, union( local!multipleOf5, local!indexesContains5 ), {} ), false() ) )
Its working Thank You!
a!localVariables(
local!test:a!forEach(
items: 101+enumerate(100),
expression:if(mod(fv!item,5)=0,fv!item,{}) ),
local!test
)
a!localVariables( local!data:a!forEach( items: enumerate(100)+101, expression: {if(mod(fv!index,5),{},fv!item),if(find(5,fv!item),fv!item,{})} ), union(local!data,local!data) )
Hi
Once try it with this..
a!localVariables( local!data: a!forEach( items: enumerate(101)+100, expression: append(if(find(5,fv!item),fv!item,{}),if(mod(fv!item,5),{},fv!item)), ), local!uniqueData:union(local!data,local!data), local!uniqueData)
i just saw my work has the same error. tks
papa's games
Nice challenge, but for what purpose? Below my approach.
{ 105 + enumerate(9) * 5, 150 + enumerate(11), 160 + enumerate(9) * 5, }
Unknown said:Nice challenge
indeed.
i was, also, wondering if this could be reduced to something more elegant/simple and I just came up with this:
(enumerate(20) + 21) * 5
Though of course a lot depends on unfilled assumptions - how long of a list do we need? Are we assuming it ends at "200" or is that just an example ending point?