exercise definition
You are asked to develop a program that reads the description of an automaton (including initial configuration) from standard input, and then computes and displays a specified number of generations. The input is specified as follows (all items mentioned are separated by white space):
1. The letter A, B, or U indicating the type of automaton to be executed.
2. A positive integer L being the number of cells of the automaton.
3. A positive integer G being the number of generations to be computed and displayed (including the initial configuration).
4. The word init_start, followed by one or more positive integers, followed by the word init_end. The integers are the positions of the occupied cells in the initial configuration (the first cell in the grid has position 1). All other cells are empty in the initial configuration. When an integer is higher than the number of cells L it should be ignored.
5. In case of automaton type U (universal automaton) 8 0’s and 1’s representing the Boolean values b0, b1, …, b7 mentioned in the description of the rule set for a universal automaton above (0 representing false, 1 representing true).
The output should be a sequence of G rows representing the successive generations. The first row is the initial generation. Each row consists of L characters each representing the state of one cell. An empty cell is displayed as a space, an occupied cell as the character *. Each row is terminated with an end-of-line.
Input and corresponding output are illustrated in the following two examples: see image.