help with „Lists“

Home Forums Puzzles help with „Lists“

This topic contains 5 replies, has 2 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 2 days, 6 hours ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22750
    alfred
    alfred
    Licensee

    Hallo Verge Team,

    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:5a4e9f7c1d/applications/Lotto_01/Lotto_01.html

    i need a little help with „Lists“
    In my app i build this construction to lift a ball from a bowl.
    All balls are in a List called „balliste“

    But how can I edit (detect) the ball that was lifted up?
    How can i get the name of this ball in the List?

    ideas would be very welcome!
    Thanks for help :) :bye:

    puzzle in the screenshot does not the job… :wacko:

    Attachments:
    You must be logged in to view attached files.
    #22761
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    you can use the find puzzle to get the index position of an object in the list:

    https://www.soft8soft.com/docs/manual/en/puzzles/Lists.html#find

    then just get the item by using that index:

    https://www.soft8soft.com/docs/manual/en/puzzles/Lists.html#get_remove

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #22792
    alfred
    alfred
    Licensee

    Hello Yuri,

    i think its not so easy, because the ball that is lifted up with the yellow stick is always random. (and i dont know its name)
    The only thing i know about the lifted ball is, that its Z-Value is bigger than 3. Its Z-Value is the biggest in the list.
    To find its position in List, there should be
    a function that finds the ball with the highest z-value in the list.

    Is this possible with puzzles?
    :scratch:

    puzzle in the screenshot does not the job…

    Attachments:
    You must be logged in to view attached files.
    #22808
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    I see, you need to find an element in a list with the biggest Z-value. Then you can use the for each puzzle, and loop through your list elements, comparing the Z-value of each element with the previously found Z-value stored in a variable. If Z-value is higher then you save it to that variable (and also save the index of an element to another variable) and continue looping and comparing until the end of the list. In the end, the value of the second “index” variable will be the result you are looking for.

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #22819
    alfred
    alfred
    Licensee

    hi yuri,
    this sounds like a puzzle adventure. ;-)
    next weekend is perfect to go this way.
    i will keep you up-todate.
    thanks for the advice.
    :bye:

    #22844
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    sure, let us know how it goes!

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.