Skip to main content
edited body
Source Link
Fred Simons
  • 10.2k
  • 19
  • 50

I think the following code solves your problem:

list={"time","Snow","mother","queen","stepmother","magic","day","queen","huntsman"};
f=list[[1]];
{Button["Previous", 
  list=RotateLeft[list];list=RotateRight[list]; f=list[[1]]],
Button["Next", 
  list=RotateRight[list];list=RotateLeft[list]; f=list[[1]]]}
Dynamic[f]

I think the following code solves your problem:

list={"time","Snow","mother","queen","stepmother","magic","day","queen","huntsman"};
f=list[[1]];
{Button["Previous", 
  list=RotateLeft[list]; f=list[[1]]],
Button["Next", 
  list=RotateRight[list]; f=list[[1]]]}
Dynamic[f]

I think the following code solves your problem:

list={"time","Snow","mother","queen","stepmother","magic","day","queen","huntsman"};
f=list[[1]];
{Button["Previous", 
  list=RotateRight[list]; f=list[[1]]],
Button["Next", 
  list=RotateLeft[list]; f=list[[1]]]}
Dynamic[f]
Source Link
Fred Simons
  • 10.2k
  • 19
  • 50

I think the following code solves your problem:

list={"time","Snow","mother","queen","stepmother","magic","day","queen","huntsman"};
f=list[[1]];
{Button["Previous", 
  list=RotateLeft[list]; f=list[[1]]],
Button["Next", 
  list=RotateRight[list]; f=list[[1]]]}
Dynamic[f]