It looks like you're new here. If you want to get involved, click one of these buttons!
<<set $pies = [ "Blueberry", "Cherry", "Cream", "Pecan", "Pumpkin" ]>> <<set _x = $pies.pluck()>> <<set $x = $pies.pluck()>> I'll choose the <span id="pie"></span>, please.\ <<timed 3s>><<replace "#pie">><<link "OPTION 1" >><<print '<img src="' + $x + '.jpg" height="100" width="100">' >> <<goto _x>> <</link>><</replace>>\ <<next>><<replace "#pie">><<link "OPTION 2" >><<goto $x>><<print '<img src="' + $x + '.jpg" height="100" width="100">' >> <</link>><</replace>>\ <</timed>>This doesn't work.
<<link [img[$x][$x]]>> <</link>>This ,while not what I want to set out to do, also doesn't work for various reasons which I dont understand. First <<link>> only reads $x as $x and not as a value from an array..
<<timed 3s>><<replace "#pie">><<link "OPTION 1" >><<print '<img src="' + $pies.pluck() + '.jpg" height="100" width="100">' >> <<goto _x>> <</link>><</replace>>\ <<next>><<replace "#pie">><<link "OPTION 2" >><<goto $x>><<print '<img src="' + $pies.pluck() + '.jpg" height="100" width="100">' >> <</link>><</replace>>\ <</timed>>Suddenly $pies.pluck() works for me and now my code goes through different random images.
<<link [[$pies.pluck()|$t]] "$t">><</link>>
Comments
<<link "$x">><<goto $x><</link>>
This does work. Now I'd like to insert an image link there and have different images cycle through, thats what I cant get it to work
Edit: Okay, shut down the thread. Just kidding. I have everything I wanted working. This takes a random number, assigns it to a variable, and displays that numbers associated image and passage.
And I repeat this code over and over until the need for using loop arises.
How about you explain what it is, exactly, you're attempting to do and I tell you how to do that.
So I want , and made, an image of pecan and a link to go to pecan passage to show up for a set amount of time, before going to the next $pie.
This i've done with the above code. Now I'd like to loop it,.
For example, the following will show 100 image links—an initial one, then it will cycle 99 more: If you just wanted to cycle through the image links in-order over and over, rather than randomly plucking the list to exhaustion and restarting, then this could be a bit simpler.
why doesn't this work for me?