Skip to content

tudorpaisa/terminal-automata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Terminal Automata

A terminal script that outputs in ASCII the evolution of a one-dimensional cellular automaton when given a pattern and an array size.

The script is fairly easy to use; you just have to compile the file (no dependencies required)

g++ -o terminal-automata.o terminal-automata.cpp
./terminal-automata.o

You will be asked to input the size of the one-dimensional array. This will determine the length of the output as well. Moreover, you will be asked about the starting position of the first live cell. This is "necessary" because some patterns fill only half of the canvas.

You then have to input the rule for each individual pattern. If you don't know any, the table below has a few examples. For more, go to Wolfram MathWorld

Rule Start Pos 111 110 101 100 011 010 001 000
30 m 0 0 0 1 1 1 1 0
110 e 0 1 1 0 1 1 1 0

Examples


                                        *                                        
                                       ***                                       
                                      **  *                                      
                                     ** ****                                     
                                    **  *   *                                    
                                   ** **** ***                                   
                                  **  *    *  *                                  
                                 ** ****  ******                                 
                                **  *   ***     *                                
                               ** **** **  *   ***                               
                              **  *    * **** **  *                              
                             ** ****  ** *    * ****                             
                            **  *   ***  **  ** *   *                            
                           ** **** **  *** ***  ** ***                           
                          **  *    * ***   *  ***  *  *                          
                         ** ****  ** *  * *****  *******                         
                        **  *   ***  **** *    ***      *                        
                       ** **** **  ***    **  **  *    ***                       
                      **  *    * ***  *  ** *** ****  **  *                      
                     ** ****  ** *  ******  *   *   *** ****                     
                    **  *   ***  ****     **** *** **   *   *                    
                   ** **** **  ***   *   **    *   * * *** ***                   
                  **  *    * ***  * *** ** *  *** ** * *   *  *                  
                 ** ****  ** *  *** *   *  ****   *  * ** ******                 
                **  *   ***  ****   ** *****   * ***** *  *     *                
               ** **** **  ***   * **  *    * ** *     *****   ***               
              **  *    * ***  * ** * ****  ** *  **   **    * **  *              
             ** ****  ** *  *** *  * *   ***  **** * ** *  ** * ****             
            **  *   ***  ****   **** ** **  ***    * *  ****  * *   *            
           ** **** **  ***   * **    *  * ***  *  ** ****   *** ** ***           
          **  *    * ***  * ** * *  ***** *  ******  *   * **   *  *  *          
         ** ****  ** *  *** *  * ****     ****     **** ** * * *********         
        **  *   ***  ****   **** *   *   **   *   **    *  * * *        *        
       ** **** **  ***   * **    ** *** ** * *** ** *  ***** * **      ***       
      **  *    * ***  * ** * *  **  *   *  * *   *  ****     * * *    **  *      
     ** ****  ** *  *** *  * **** **** ***** ** *****   *   ** * **  ** ****     
    **  *   ***  ****   **** *    *    *     *  *    * *** **  * * ***  *   *    
   ** **** **  ***   * **    **  ***  ***   ******  ** *   * *** * *  **** ***   
  **  *    * ***  * ** * *  ** ***  ***  * **     ***  ** ** *   * ****    *  *  
 ** ****  ** *  *** *  * ****  *  ***  *** * *   **  ***  *  ** ** *   *  ****** 
**  *   ***  ****   **** *   ******  ***   * ** ** ***  ******  *  ** *****     *

                                                                                
                                                                                *
                                                                               **
                                                                              ***
                                                                             ** *
                                                                            *****
                                                                           **   *
                                                                          ***  **
                                                                         ** * ***
                                                                        ******* *
                                                                       **     ***
                                                                      ***    ** *
                                                                     ** *   *****
                                                                    *****  **   *
                                                                   **   * ***  **
                                                                  ***  **** * ***
                                                                 ** * **  ***** *
                                                                ******** **   ***
                                                               **      ****  ** *
                                                              ***     **  * *****
                                                             ** *    *** ****   *
                                                            *****   ** ***  *  **
                                                           **   *  ***** * ** ***
                                                          ***  ** **   ******** *
                                                         ** * ******  **      ***
                                                        *******    * ***     ** *
                                                       **     *   **** *    *****
                                                      ***    **  **  ***   **   *
                                                     ** *   *** *** ** *  ***  **
                                                    *****  ** *** ****** ** * ***
                                                   **   * ***** ***    ******** *
                                                  ***  ****   *** *   **      ***
                                                 ** * **  *  ** ***  ***     ** *
                                                ******** ** ***** * ** *    *****
                                               **      ******   ********   **   *
                                              ***     **    *  **      *  ***  **
                                             ** *    ***   ** ***     ** ** * ***
                                            *****   ** *  ***** *    ********** *
                                           **   *  ***** **   ***   **        ***
                                          ***  ** **   ****  ** *  ***       ** *
                                         ** * ******  **  * ***** ** *      *****
                                        *******    * *** ****   ******     **   *
                                       **     *   **** ***  *  **    *    ***  **
                                      ***    **  **  *** * ** ***   **   ** * ***
                                     ** *   *** *** ** ******** *  ***  ******* *
                                    *****  ** *** ******      *** ** * **     ***
                                   **   * ***** ***    *     ** *********    ** *
                                  ***  ****   *** *   **    *****       *   *****
                                 ** * **  *  ** ***  ***   **   *      **  **   *
                                ******** ** ***** * ** *  ***  **     *** ***  **
                               **      ******   ******** ** * ***    ** *** * ***
                              ***     **    *  **      ******** *   ***** ***** *
                             ** *    ***   ** ***     **      ***  **   ***   ***
                            *****   ** *  ***** *    ***     ** * ***  ** *  ** *
                           **   *  ***** **   ***   ** *    ******* * ***** *****
                          ***  ** **   ****  ** *  *****   **     *****   ***   *
                         ** * ******  **  * ***** **   *  ***    **   *  ** *  **
                        *******    * *** ****   ****  ** ** *   ***  ** ***** ***
                       **     *   **** ***  *  **  * ********  ** * *****   *** *
                      ***    **  **  *** * ** *** ****      * *******   *  ** ***
                     ** *   *** *** ** ******** ***  *     ****     *  ** ***** *
                    *****  ** *** ******      *** * **    **  *    ** *****   ***
                   **   * ***** ***    *     ** ******   *** **   *****   *  ** *
                  ***  ****   *** *   **    *****    *  ** ****  **   *  ** *****
                 ** * **  *  ** ***  ***   **   *   ** *****  * ***  ** *****   *
                ******** ** ***** * ** *  ***  **  *****   * **** * *****   *  **
               **      ******   ******** ** * *** **   *  ****  *****   *  ** ***
              ***     **    *  **      ******** ****  ** **  * **   *  ** ***** *
             ** *    ***   ** ***     **      ***  * ****** *****  ** *****   ***
            *****   ** *  ***** *    ***     ** * ****    ***   * *****   *  ** *
           **   *  ***** **   ***   ** *    *******  *   ** *  ****   *  ** *****
          ***  ** **   ****  ** *  *****   **     * **  ***** **  *  ** *****   *
         ** * ******  **  * ***** **   *  ***    ***** **   **** ** *****   *  **
        *******    * *** ****   ****  ** ** *   **   ****  **  ******   *  ** ***
       **     *   **** ***  *  **  * ********  ***  **  * *** **    *  ** ***** *
      ***    **  **  *** * ** *** ****      * ** * *** **** ****   ** *****   ***
     ** *   *** *** ** ******** ***  *     ********* ***  ***  *  *****   *  ** *
    *****  ** *** ******      *** * **    **       *** * ** * ** **   *  ** *****
   **   * ***** ***    *     ** ******   ***      ** **************  ** *****   *
  ***  ****   *** *   **    *****    *  ** *     *****            * *****   *  **
 ** * **  *  ** ***  ***   **   *   ** *****    **   *           ****   *  ** ***

About

ASCII output of Cellular Automata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages