App-GUI-Cellgraph

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.1  2022-12-25  lichtkind
-------
    * = multi level bug fix release
    * + bring back cell mobility with previous fixed feature set
    * ? update docs
    * ! crashes on most buttons to get related rules

0.03  2022-12-19  lichtkind
-------
    * = feature expand
    * + greater state alphabets for cells states and actions states
    * + 6 different input neighbourhood sizes
    * + circular cell ordering option
    * - removed cell mobility for now
    * ! no draw when enter new rule number in text field and press enter

0.02  2022-11-03  lichtkind
-------
    * = init release
    * + changeable subrules with fixed input size = 3

README  view on Meta::CPAN

        later

        After first use of the program, a config file will be created under
        *~/.config/cellgraph* in your home directory. It contains mainly
        stored colors and dirs where to load and store setting files. You
        may change it manually or deleted it to reset it to default.

DESCRIPTION
    This graphical application uses cellular automata logic, as described in
    *Steve Wolfram*s book *"A new kind of science"*, to paint tiled
    pictures. Although, the original concept got expanded by many additional
    options and functionalities.

    It is meant for fun, leasure, beautiful, personalized images and a
    deeper understanding about how cellular automatons work.

Mechanics
    Every tile (square) in the picture represents one automaton (called
    cell). The tile color depicts the state of that cell. The state is just
    an one digit number (0 or 1 at start). To see and change which color
    stands for which state - choose the rightmost tab titled "*Colors*". The

lib/App/GUI/Cellgraph.pm  view on Meta::CPAN

I<~/.config/cellgraph> in your home directory. It contains mainly
stored colors and dirs where to load and store setting files.
You may change it manually or deleted it to reset it to default.

=back

=head1 DESCRIPTION

This graphical application uses cellular automata logic, as described in
I<Steve Wolfram>s book  I<"A new kind of science">, to paint tiled pictures.
Although, the original concept got expanded by many additional options
and functionalities.

It is meant for B<fun>, leasure, B<beautiful>, personalized images
and a deeper B<understanding> about how cellular automatons work.


=for HTML <p>
<img src="https://raw.githubusercontent.com/lichtkind/App-GUI-Cellgraph/main/example/POD/30.png"      alt=""  width="300" height="300">
<img src="https://raw.githubusercontent.com/lichtkind/App-GUI-Cellgraph/main/example/POD/blauberg.png"alt=""  width="300" height="300">
<img src="https://raw.githubusercontent.com/lichtkind/App-GUI-Cellgraph/main/example/POD/7io.png"     alt=""  width="300" height="300">

lib/App/GUI/Cellgraph/Settings.pm  view on Meta::CPAN

use FindBin;
use File::Spec;

# parameter of a drawing

package App::GUI::Cellgraph::Settings;

sub load {
    my ($file) = @_;
    return unless defined $file;
    $file = expand_path( $file );
    my $data = {};
    open my $FH, '<', $file or return "could not read $file: $!";
    my $cat = '';
    while (<$FH>) {
        chomp;
        next unless $_ or substr( $_, 0, 1) eq '#';
        if    (/\s*\[(\w+)\]/)           { $cat = $1 }
        elsif (/\s*(\w+)\s*=\s*(.+)\s*$/){ $data->{$cat}{$1} = $2 }
    }
    close $FH;

lib/App/GUI/Cellgraph/Settings.pm  view on Meta::CPAN


sub shrink_path {
    my ($path)  = @_;
    my $i = index($path, $FindBin::Bin );
    $path = '.' . substr( $path, length $FindBin::Bin) if $i > -1;
    $i = index($path, $ENV{HOME} );
    $path = '~' . substr( $path, length $ENV{HOME}) if $i > -1;
    $path;
}

sub expand_path {
    my ($path)  = @_;
    $path = File::Spec->catdir( $FindBin::Bin, substr( $path, 1) ) if substr($path, 0,1) eq '.';
    $path = File::Spec->catdir( $ENV{HOME}, substr( $path, 1) ) if substr($path, 0,1) eq '~';
    $path;
}


sub are_equal {
    my ($h1, $h2)  = @_;
    return 0 unless ref $h1 eq 'HASH' and ref $h2 eq 'HASH';



( run in 1.283 second using v1.01-cache-2.11-cpan-5b529ec07f3 )