random scenes using composer

Yes I have a problem on that three parts and last would be the result scene  (consistent as the last scene to be shown ). I may either have a problem where to put and what code needed to be typed

Each of those parts is going to take some investigation and education on your part to achieve. I can guarantee that questions relating to each of those parts have been asked (and answered) in the Corona forums here. I already put up a link for scene randomization, which should give you a pretty good starting point. 

It’s important for you to separate each of these parts, so that you can confirm that the first part works outside of the scene management logic. Then, you want to confirm that your scenes work without your “randomized progression” logic. Then you can put the first two parts together to achieve the third part. 

If i used this code:

  1. for i=1, 3 do 
  2.     postable[i]=i
  3. end
  4.             
  5. local function shuffle(t)
  6.         local iterations = #t
  7.             local j
  8.             for i = iterations,2, -1 do
  9.         j = math.random(i)
  10.                 t[i], t[j] = t[j], t[i]
  11.     end
  12.            
  13.         end
  14.         shuffle(postable)
  15.  
  16.     
  17. for i = 1 , (#postable) do
  18.     print(postable[i] )
  19. end​​​

​how can i go to random scenes? do i need to put all the scenes in one lua script? how can I go to result scene which always be at the last?

It is working on terminal but the questions are still not answered. I am thinking of getting the indexes of each array but dont know what the code is something like this if possible:

TERMINAL:

3

2

1

CODE:

composer.gotoScene(array name[1], “animation”, “delay”);

Thanks for the help of those who post and answered the question xDDD

Here’s an update when I create a prototype of the array_shuffle and combines the built in sample program of composer module it works but only on the first scene the other scenes are not:

Flow:

1st attempt = 2,3,4,1

2nd attempt = 1,2,3,4

3rd attempt = 4,1,2,3

4th attempt = 3,4,1,2

as you observed only the first scene do randomizing the others are just sequentially display. I need the other scenes shuffle also

Terminal:

4

3

1

2

Expected flow:

1st attempt = 4,3,1,2, result

when the button is press and showing the last page as result

suggestions and/or a helping hand will be great appreciated =)