Zur Beschreibungsseite auf Commons

Datei:CARuleComparison18-18R.png

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

CARuleComparison18-18R.png(200 × 100 Pixel, Dateigröße: 5 KB, MIME-Typ: image/png)

Diese Datei und die Informationen unter dem roten Trennstrich werden aus dem zentralen Medienarchiv Wikimedia Commons eingebunden.

Zur Beschreibungsseite auf Commons


Beschreibung

Beschreibung Evolution of elementary CA rule 18 and its second order counterpart from the same initial state. Time runs downwards. Note the up/down asymmetric triangles formed by the nonreversible rule.
Datum 20. März 2006 (Original-Hochladedatum)
Quelle Die Autorenschaft wurde nicht in einer maschinell lesbaren Form angegeben. Es wird angenommen, dass es sich um ein eigenes Werk handelt (basierend auf den Rechteinhaber-Angaben).
Urheber Die Autorenschaft wurde nicht in einer maschinell lesbaren Form angegeben. Es wird Maksim als Autor angenommen (basierend auf den Rechteinhaber-Angaben).

Lizenz

Public domain Ich, der Urheberrechtsinhaber dieses Werkes, veröffentliche es als gemeinfrei. Dies gilt weltweit.
In manchen Staaten könnte dies rechtlich nicht möglich sein. Sofern dies der Fall ist:
Ich gewähre jedem das bedingungslose Recht, dieses Werk für jedweden Zweck zu nutzen, es sei denn, Bedingungen sind gesetzlich erforderlich.

Perl script

This image was generated by combining two PBM images generated by the following Perl script, which is released into the public domain under the same terms as the image itself. The script, if saved as "capbm.pl", may be invoked as:

perl capbm.pl rule[R] width height [ line1 [ line0 ] ] >output.pbm

where:

  • rule is the Wolfram code for the rule, with "R" appended for second-order rules,
  • width and height are the dimension of the output image in pixels/cells,
  • line1 is the starting configuration as a string of zeros and ones, padded by zeros on both sides if necessary (default = "1"),
  • line0 is the previous generation (for second-order rules) in the same format as line1 (default = ""),
  • output.pbm is the name of the image to create,

and square brackets denote optional parameters.

#!/usr/bin/perl -w
use strict;

my $rule = shift || 110;

$rule =~ /^(\d+)(R?)$/i and $1 < 256 or die "Invalid rule: '$rule'\n";
$rule = $1;
my $r = $2;

my %map;
$map{unpack "B3", pack "C", $_ << 5} =
    ($rule >> $_) & 1 for 0 .. 7;

my $w = shift || 200;
my $h = shift || $w;

$w =~ /\D/ and die "Invalid width: '$w'\n";
$h =~ /\D/ and die "Invalid heigth: '$h'\n";

my $pat1 = shift || "1";
$pat1 =~ /[^01]/ and die "Invalid pattern: '$pat1'\n";
length($pat1) > $w and die "Pattern too long.\n";

my $pat2 = shift || "";
$pat2 =~ /[^01]/ and die "Invalid pattern 2: '$pat2'\n";
length($pat2) > $w and die "Pattern 2 too long.\n";

my $buf1 = my $buf2 = "0" x $w;

substr($buf1, ($w-length($pat1))/2, length($pat1), $pat1);
substr($buf2, ($w-length($pat2))/2, length($pat2), $pat2);

print "P1 $w $h\n";
#$h--, print $buf2, "\n" if $r and $h;

while ($h--) {
    print $buf1, "\n";
    unless ($r) {
        substr($buf2,  0, 1, $map{substr($buf1, -1).substr($buf1, 0, 2)});
        substr($buf2, $_, 1, $map{substr($buf1, $_-1, 3)}) for 1 .. $w-2;
        substr($buf2, -1, 1, $map{substr($buf1, -2).substr($buf1, 0, 1)});
    } else {
        substr($buf2,  0, 1) ^= $map{substr($buf1, -1).substr($buf1, 0, 2)};
        substr($buf2, $_, 1) ^= $map{substr($buf1, $_-1, 3)} for 1 .. $w-2;
        substr($buf2, -1, 1) ^= $map{substr($buf1, -2).substr($buf1, 0, 1)};
    }
    last unless $h--;

    print $buf2, "\n";
    unless ($r) {
        substr($buf1,  0, 1, $map{substr($buf2, -1).substr($buf2, 0, 2)});
        substr($buf1, $_, 1, $map{substr($buf2, $_-1, 3)}) for 1 .. $w-2;
        substr($buf1, -1, 1, $map{substr($buf2, -2).substr($buf2, 0, 1)});
    } else {
        substr($buf1,  0, 1) ^= $map{substr($buf2, -1).substr($buf2, 0, 2)};
        substr($buf1, $_, 1) ^= $map{substr($buf2, $_-1, 3)} for 1 .. $w-2;
        substr($buf1, -1, 1) ^= $map{substr($buf2, -2).substr($buf2, 0, 1)};
    }
}

__END__

Original file history on the English Wikipedia

  • 19:53, 29 August 2005 . . Ilmari Karonen (Talk) . . 200x100 (5166 bytes) (Evolution of elementary CA rule 18 and its second order counterpart from the same initial state. Time runs downwards. Note the up/down asymmetric triangles formed by the nonreversible rule. {{PD-)

Kurzbeschreibungen

Ergänze eine einzeilige Erklärung, was diese Datei darstellt.

In dieser Datei abgebildete Objekte

Motiv

image/png

4057bdc123ed1bda107e5766c0c96e66ceae4c3a

5.166 Byte

100 Pixel

200 Pixel

Dateiversionen

Klicke auf einen Zeitpunkt, um diese Version zu laden.

Version vomVorschaubildMaßeBenutzerKommentar
aktuell19:16, 20. Mär. 2006Vorschaubild der Version vom 19:16, 20. Mär. 2006200 × 100 (5 KB)MaksimLa bildo estas kopiita de wikipedia:en. La originala priskribo estas: Evolution of elementary CA rule 18 and its second order counterpart from the same initial state. Time runs downwards. Note t

Die folgenden 2 Seiten verwenden diese Datei:

Globale Dateiverwendung

Die nachfolgenden anderen Wikis verwenden diese Datei: