File:CA rule110s.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this preview: 600 × 600 pixels. Other resolutions: 240 × 240 pixels | 480 × 480 pixels | 768 × 768 pixels | 1,024 × 1,024 pixels | 2,048 × 2,048 pixels | 10,000 × 10,000 pixels.
Original file (10,000 × 10,000 pixels, file size: 167 KB, MIME type: image/png)
File information
Structured data
Captions
Summary
[edit]DescriptionCA rule110s.png | See below. |
Date | |
Source | Own work by the original uploader |
Author | Grondilu (talk) (Uploads) |
Other versions |
Made with the following Perl code: use strict; use warnings; use GD; package Automaton { sub new { my $class = shift; my $rule = [ reverse split //, sprintf "%08b", shift ]; return bless { rule => $rule, cells => [ @_ ] }, $class; } sub next { my $this = shift; my @previous = @{$this->{cells}}; $this->{cells} = [ @{$this->{rule}}[ map { 4 * $previous[($_ - 1) % @previous] + 2 * $previous[$_] + $previous[($_ + 1) % @previous] } 0 .. @previous - 1 ] ]; return $this; } use overload q{""} => sub { my $this = shift; join '', map { $_ ? '#' : ' ' } @{$this->{cells}} }; sub to_image { my ($this, $width, $height) = @_; my $image = GD::Image->new($width, $height); my $black = $image->colorAllocate(0, 0, 0); my $white = $image->colorAllocate(255, 255, 255); my $x = 0; my $y = 0; foreach my $cell (@{$this->{cells}}) { if ($cell) { $image->setPixel($x, $y, $black); } else { $image->setPixel($x, $y, $white); } $x++; if ($x >= $width) { $x = 0; $y++; last if $y >= $height; } } return $image; } } my ($width, $height) = (10**4, 10**4); my @a = map 0, 1 .. $width; $a[$width - 1] = 1; my $a = Automaton->new(110, @a); # Save to file open(my $out, '>', 'output.png') or die "Cannot open file: $!"; binmode $out; print $out "P1\n$width $height\n"; for (1 .. $height) { print $out join(' ', @{$a->{cells}}) . "\n"; $a->next; } close $out; |
Licensing
[edit]Grondilu at English Wikipedia, the copyright holder of this work, hereby publishes it under the following license:
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Original upload log
[edit]The original description page was here. All following user names refer to en.wikipedia.
- 2014-02-28 08:32 Grondilu 1000×1000× (10463 bytes) Made it myself with the following Perl code: <code>use strict; use warnings; package Automaton { sub new { my $class = shift; my $rule = [ reverse split //, sprintf "%08b", shift ]; return bless { rule => $rule, cells => [ @_ ] }, $class;...
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 17:14, 4 August 2023 | 10,000 × 10,000 (167 KB) | Obscure2020 (talk | contribs) | Optimized with OxiPNG and ZopfliPNG. | |
21:19, 10 July 2023 | 10,000 × 10,000 (1.75 MB) | CJKVR (talk | contribs) | Showing more executions | ||
20:41, 27 February 2014 | 1,000 × 1,000 (10 KB) | Grondilu (talk | contribs) | Bigger version, right aligned. | ||
17:55, 18 March 2006 | 500 × 250 (2 KB) | Maksim (talk | contribs) | La bildo estas kopiita de wikipedia:en. La originala priskribo estas: Smaller version of CA_rule110.png {{GFDL}} {| border="1" ! date/time || username || edit summary |---- | 21:57, 1 February 2005 || en:User:Quadell || <nowiki>(tagged)</nowiki> | |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on de.wikipedia.org
- Usage on es.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on he.wikipedia.org
- Usage on it.wikipedia.org
- Usage on ja.wikipedia.org
- Usage on ko.wikipedia.org
- Usage on nl.wikipedia.org
- Usage on ro.wikipedia.org
- Usage on ru.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on sv.wikipedia.org
- Usage on zh-yue.wikipedia.org
Structured data
Items portrayed in this file
depicts
28 February 2014
image/png
9b1b62f5bf9ee9a880d31358b7337a51c56c12d9
170,613 byte
10,000 pixel
10,000 pixel
Hidden categories: