Write a program which simulates a forest fire

Assignment Help Computer Engineering
Reference no: EM13701614

Program: Write a program which simulates a forest fire on a 12 x 12 matrix. You will model the effects of the fire from it's inception until it burns out. Each cell in the grid is in one of three possible states:

Part 1: Forest (notburning)

(^)

Part 2: Burning Forest (*)

Part 3: Empty (previously burnt or cleared) (.)

Each turn, you will apply the following rules to the fire:

? If the cell is currently Empty, it will stay Empty

? If the cell is currently Burning, it will be set to Empty in the next time step

? If the cell is currently a Forest, and none of the cells neighbors are burning, the cell will stay as a Forest

? If a cell is currently a Forest, and one or more neighboring cells are burning, then the cell will be set to Burning in the next time step with probability p. The probability of burning is a parameter that can be set by the user.

You need to make well-formed and clean code. You should not copy and paste the code from other source.

You will prompt the user to enter the number of locations originally burning and the computer will randomly assign the spots. Apply the rules above each turn until the fire burns out or consumes the forest. When the simulation is complete, you will have the computer display the percentage area burned and the number of steps required to do it.

Reference no: EM13701614

Questions Cloud

Convert the regular expressions to nfa : Convert the regular expressions to ? NFAs (Non-Deterministic Finite Automata). Use the modular building approach.
Perform a direct construction : Give a regular expression for each of the subsequent languages by performing a direct construction.
Provide a regular expression for the language : I am having trouble answering the subsequent question - Provide a regular expression for the language of binary strings containing at least two zeros somewhere.
Give english descriptions of the languages : Give English descriptions of the languages represented by the subsequent regular expressions. Example: "languages of binary strings containing 0 in even positions. . ."
Write a program which simulates a forest fire : Write a program which simulates a forest fire on a 12 x 12 matrix. You will model the effects of the fire from it's inception until it burns out.
What are the three basic steps of the analysis process : What are the three basic steps of the analysis process - Is each step performed in the every project? Why or why not?
Write a boolean method called sorted : Write a Boolean method called sorted that takes three int parameters and returns true if the numbers are sorted in ascending order.
Determine whether all elements of the list are distinct : Consider the subsequent decision problem: Given a list of integers, determine whether all elements of the list are distinct - Show that this question can be solved in polynomial time.
Write a c program that reads a as 100 decimal : Write a C program that reads A as 100 decimal (0x64) and calculate B so that A xor B = 120 (how do you show A B in C program?).

Reviews

Write a Review

Computer Engineering Questions & Answers

  The type of signal that is generated by altering the

the type of signal that is generated by altering the voltage magnitude of the signal up or down over time to create a

  Create program to reads in course information

Create program to reads in course information to includes class code, three digit section number, teacher's last name, number of students enrolled in section.

  Create a temperature demo program

Make sure you take no input in this class and that it does not contain a main method.

  Questioninternet protocol standards are devised throughout

questioninternet protocol standards are devised throughout the efforts of thousands of people all over the world --

  During a whole class discussion describe the association

during a whole class discussion describe the association between information systems and the concept of competitive

  What steps will you take to analyze the problem?

You are working on a new computer game. One of implementation problems you are trying to solve is character path finding. The user should be able to select a character and left-click the mouse at a location to have the character move to that new l..

  Suppose you have a relation schema about teaching classes

suppose you have a relation schema about teaching classes that has the following attributes class instructor time and

  To use a computer for multimedia video and sound it is

to use a computer for multimedia video and sound it is important to maximize the efficiency of the io. assume that the

  Choose the employee''s last name

Group employees by salary within their job code: choose the employee's last name and group them by salary within their job_title_code.

  As an it technician describe three separate examples where

1 as an it technician describe three separate examples where you would recommend the use of 1 a cd 2 a dvd and 3 a bd

  Differences between the java programming languages

What are the main differences between the Java programming language and the language discussed

  Oe of the needs that your client has is a databaseto

one of the needs that your client has is a database.to design a database a database planner should spend a

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd