1
$\begingroup$

I want to generate a different random initial condition for rule 110 using a Button for Manipulate, not a slider. How can I make the slider invisible here? I tried specifying ControlType -> None, and made the Button disappear.

 Manipulate[
 SeedRandom[seed];
 ArrayPlot[CellularAutomaton[110, RandomInteger[1, 600], 700]],
 { seed, 1, 1000, 1}, 
 Button["Randomize initial condition", 
  If [seed < 1000, seed = seed + 1, seed = seed - 1]]]
$\endgroup$
  • 1
    $\begingroup$ Did you do it like this?: {seed, 1, 1000, 1, ControlType -> None} $\endgroup$ – Michael E2 Jan 25 '15 at 2:15
  • $\begingroup$ No, I tried: Manipulate[ SeedRandom[seed]; ArrayPlot[CellularAutomaton[110, RandomInteger[1, 600], 700]], { seed, 1, "", 1000, 1}, Button["Randomize initial condition", If [seed < 1000, seed = seed + 1, seed = seed - 1]], ControlType -> None], and thanks, that works $\endgroup$ – andandandand Jan 25 '15 at 2:18
  • $\begingroup$ Done. And you're welcome! $\endgroup$ – Michael E2 Jan 25 '15 at 2:59
2
$\begingroup$

To have no control for seed to appear, apply the option ControlType -> None to the variable:

 Manipulate[
 SeedRandom[seed];
 ArrayPlot[CellularAutomaton[110, RandomInteger[1, 600], 700]],
 {seed, 1, 1000, 1, ControlType -> None}, 
 Button["Randomize initial condition", 
  If [seed < 1000, seed = seed + 1, seed = seed - 1]]]
$\endgroup$
  • 1
    $\begingroup$ Note also that {seed, 1, 1000, 1, None} will suffice. $\endgroup$ – Mike Honeychurch Jan 25 '15 at 5:11
  • $\begingroup$ @MikeHoneychurch Yes, an explanation may be found in my answer here, which was a question prompted by my use of it here. At some point since that time, I decided to use the longer form, at least on this site, because it occurs in the documentation and is more readable. $\endgroup$ – Michael E2 Jan 25 '15 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.