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

  Describe why data structure is helpful and important in

discuss why data structure is useful and important in programing. use your own examples to explain what an array is

  How do i build a sample cmm model

What is the needs for relevant quality standards and quality management.

  Create and development phases of software development

consider efforts that can be done at design and development phases of software development which pay dividends later in software maintenance, that is, improve the ability to maintain.

  Show an appropriate message regarding the bonus

show an appropriate message regarding the bonus when the QuarterlySales for the SalesPerson falls within these ranges.

  What happen if you did not break

When using Case statements, what would happen if you did not "Break?" Please give an example and explain. Where, in your everyday life, would you use all of the looping techniques.

  Cross-validation and percentage split

Comparing the accuracies received utilizing the three "test options": "Utilize the training set", "cross-validation" and "percentage split".

  Define the rule that is applied to place a class

The system development team at Wilson Company is working on developing a new customer order entry system. In the method on designing the new system, the team has identified the following class and its attributes.

  Explain the software packages in detail

explain the software packages in detail. analysis of the advantages and disadvantages of each of the software packages used.

  Make use of method iteration to find a formula expressing

How several elementary operations are used in the following algorithm? The elementary operations are comparison operations (such as > and

  Design a visual studio.net 2005

Add a Menu control and a Label control to the form. Populate the Menu control with data stored in the "Font" column and display your name in Label control (Barnes). Write down an event-handler that changes the font type in the Label control based o..

  Why do you think that your hard drive is not using fifo

why do you think that your hard drive is not using fifo? there are programs available that will disable fifo. if you

  How does the it environment in your organization contribute

How does the IT environment in your organization contribute to the complexity of managing IT professionals? Explain.

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