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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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