Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help written in javascript : 2 files given for the grid canvas: html given: This project is to wite a program to display the generational

Help written in javascript :

image text in transcribed

2 files given for the grid canvas:

image text in transcribed

html given:

image text in transcribed

This project is to wite a program to display the generational progress of Wolfram's Rule-45 cellular automaton. The program will be written in Javascript with an HTML web page for display The cella "growth generations will be shown in a 2D grid of black and white cells. Each row after the top will show the next generation. Rule-45 Wolfram's Rule-45 (from his 2002 book "A New Kind of Science) is based on a 1D array where each cell is "active". What happens to it depends on its current binary state (1 or 0, white or black) and the states of its two neighbors; 3 cells in all. With 3 binary cells, there are 8 possible configurations. A Rule needs to specify what happens to a cell with each of those 8 neighborly configurations. Rule-45 looks like this: rule 45 Walfrum, 2002 This Rule format is interpreted as follows: leftmost is a cell containing all black (I's, or filled cells). If the center cell and its two neighbors are in state 1, then in the next generation, the cell will change to state 0 (white, clear). Put differently, if the binary number represented by the 3 cells is 111-7, then the middle cell will be changes to state 0 in the next generation. A similar analysis is used for the other 7 triple-cell states. Now, if we treat the next generation states as 8 bits of a binary number, then these 8 configurations generate (from left to right) the bits 00101101, which equals a decimal 45. Hence, this set of state transitions based on 3-cells each is called Rule-45 Setup Your program should initialize a 400 by 400 square grid to have all cells empty (state 0). Then set the top row's 200th (just left of center) cell in state I. This represents the initial (#0-seeded) generation. Include your team name on the web page above the grid Running After setup, your program should show on the next row down the next (#1) generation of Rule-45 operating on every row cell. You should presume that a "neighboring cell" off the right or left side of the grid is empty (This limits the right and left border cells to only 4 of the 8 possible configurations, each) Similarly, continue running until all 400 rows (generations) have been shown. Then stop NB generations #0 thru #3 should look like this (roughly, using black for state and this is only the center area of the first 4 rows) 1 and white for state Complexity Order You should prepare a 1-page paper descnbing your analysis of the Big-O nunning time of your algorithm. Address the usual issues such as main operations, input size, etc Team canvas Grid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

3 What are the stages of Kotter and Cohens model of change?

Answered: 1 week ago