Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.5K Views
|
9 Replies
|
7 Total Likes
View groups...
Share
Share this post:

'Flip-card' animation code appear to be not working

Posted 2 years ago

Hello there, I am reading Modeling Nature Cellular Automata by Richard J Gaylord book and I tried 'flip-card' animation codes (p.12 inserted below) on Wolfram Mathematica (bc I interest to see how it works) and seems to be not working. How can I fix it? Please help and thank you.

ShowCA[list_, opts__] :=
 Map[show[
    Graphics[
     RasterArray[
      list[[#]] {val1 -> RGBColor[x1, y1, z1], 
        val2 -> RGBColor[x2, y2, z2], ...}]], opts] &, 
  Range[Length[list]]]

Syntax::sntxf: "list[[#]]" cannot be followed by "{val1->RGBColor[x1,y1,z1],val2->RGBColor[x2,y2,z2],...}".
POSTED BY: Hoa Thieu Ly
9 Replies
Posted 2 years ago

Hi Hoa,

You are welcome, glad you found it useful.

To learn more about the WL, take a look at An Elementary Introduction to the Wolfram Language by Stephen Wolfram. It is available online for free.

A New Kind of Science, also by Stephen Wolfram has a lot of information on cellular automata. It is also available online for free.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Thank you for taking your time responding to my message. I appreciate you. I ran your codes. Worked. It's wonderful. I learned something new today.

Yes, You are right. I am new to both Mathematica software and Cellular Automata. I came across Modeling Nature Cellular Automata with Mathematica by Richard J. Gaylord 1996ed. and thought give it a try and learned Mathematica at the same time. Thus, I registered with Wolfram Mathematica.

You have any books/sites suggestions for me about Cellular Automata with Mathematica. There is not much on Amazon.com Again, thank you.

POSTED BY: Hoa Thieu Ly
Posted 2 years ago
POSTED BY: Updating Name
Posted 2 years ago

Hello Rohit Namjoshi and thanks again.

From Richard J. Gaylord (the author) and that was it.

We can create a "flip-card" animation of the evolution of a CA using the following command:

ShowCA[list_, opts_] ::
Map[Show[Graphics[RasterArray[list[[#]] /.
{vall -> RGBColor[xl, yl, zl],
val2 -> RGBColor[x2, y2, z2], ... }]], opts]&, Range[Length[list]]]
POSTED BY: Hoa Thieu Ly
Posted 2 years ago

What arguments are you passing to ShowCA?

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Thank you for taking your time responding to my message. I appreciate you. I took your advice, removed three dots and ran. It showed no error, but did not show the animation. I am just wondering do I need to download a certain 'add-on' software in order to see the animation. Best.

POSTED BY: Hoa Thieu Ly
Posted 2 years ago

Another problem: ... is not a valid syntax.

val2 -> RGBColor[x2, y2, z2], ...

No error if it is removed

ShowCA[list_, opts__] := 
 Map[Show[
    Graphics[
     RasterArray[
      list[[#]] /. {val1 -> RGBColor[x1, y1, z1], 
        val2 -> RGBColor[x2, y2, z2]}]], opts] &, Range[Length[list]]]
POSTED BY: Rohit Namjoshi
Posted 2 years ago
POSTED BY: Hoa Thieu Ly

Perhaps a /. is missing between list[[#]] and {val1 ->

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard