Implement a simulation of langtons ant

Assignment Help Computer Engineering
Reference no: EM132164374

Using C++ design, implement, and test a program that implements a simulation of Langton's Ant. Note that it can be considered as a cellular automaton.

This means that you have an array or matrix of cells. Each turn or step, the value of each cell may change based upon a simple rule.

For the Ant there are two simple rules. The rules are:

1. In a white square, turn right 90o and change the square to black.

2. In a black square, turn left 90o and change the square to white.

Use a blank character for a white space. You can use the number sign ("#") for black. And for the Ant? An asterisk ("*"). ? Left ? Right?

Those are relative directions! How are you going to keep track of the direction the Ant is facing? How will you "remember" what color the current cell occupied by the Ant is or was? You will create an Ant class to help organize, hold, and manipulate this information.

Program will prompt the user to enter the number of rows and columns for the 2D array. You should also prompt the user for the number of steps.

Suggest values to the user. Your program should display each step. Use functional decomposition to develop functions to validate the input.

What parameters and criteria do these functions need? You should start by asking the user for the starting location of the Ant.

You should add the option for the user to have a random starting location. For testing purposes, always start the Ant at the same location.

Then try different locations. You should start saving utility functions for future programs you write.

Reference no: EM132164374

Questions Cloud

Illustrate the effectiveness of the organization : Research at least five peer-reviewed articles from academic journals, government sources, or research institutions (e.g. Rand) to detail the police organization
Display current will display the first and last name : A Simple program is needed to keep track phone numbers. This program should allow you to enter a contact name and find that contact's phone number.
Identify the claim and state h0 and ha : (a) Identify the claim and state H0 and Ha. Which is the correct claim? below? What are H0 and Ha??
Identify the ethical dilemma raised by the facts : Identify the ethical dilemma raised by the facts and explain what the ethical dilemma is. What makes this dilemma ethical? What ethics does this dilemma.
Implement a simulation of langtons ant : Design, implement, and test a program that implements a simulation of Langton's Ant. Note that it can be considered as a cellular automaton.
Find a test statistic of the proportion : The claim is that the proportion of challenges that are successful is greater than one-third. Find a test statistic of the proportion.
What are the daily tasks that case managers are expected : What are the daily tasks that case managers are expected to perform? What are the additional or ancillary tasks that case managers might be expected to perform?
Estimate the level of significance : Using the F table, estimate the level of significance for each. Indicate whether its likelihood of occurring is greater than or less than a p level shown on the
Develop the class polynomial : Develop the class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determine the best uses of 3g and 4g technology

Compare the pros and cons of 3G and 4G technology to determine the best uses of 3G and 4G technology in today's applications

  Describe the disaster recovery plan in detail

What is the difference between a disaster recovery plan and a business continuity plan? The response must be typed.

  Write a customcar class that is derived from car class

It will need to have its own constructor. The constructor should simply call the Car constructor and then set the private features variable to be empty. See the book for an example.

  What is the maximum file size

What is the maximum file size if 32 bytes are used for metadata, and 8 bytes are used for one single indirect and one double indirect pointer?

  Discuss at least two backup strategies

Describe and discuss at least two backup strategies. Discuss the use of cloud backup strategies, as well? The response must be typed, single spaced.

  What''s the voltage and power capacity of the battery

You need replacement batteries for several Dell Precision M4400. What's the vendor's part number and price for this battery? What's the voltage and power capacity of the battery?

  Describe in detail the way in which the malware was utilized

Describe in detail the way in which the malware was utilized to steal data or gain privileged remote access to a computer or network.

  Why would you use dac instead of mac

Why would you use DAC instead of MAC? Why would you use DAC instead of MAC? Does using MAC without running DAC underneath make any sense?

  A globally interconnected commercial world has emerged

a globally interconnected commercial world has emerged from the technical advances that created the internet. has its

  Give any relationship that may exist between the principle

You are to explore the principles of data abstraction, inheritance and dynamic binding. Use the Library to get started on finding resources. Take each term and describe it.

  Brightidea is in the file storage business they give file

brightidea is in the file storage business. they provide file storage to free and paid clients all over the world. at

  Implementing type parameterization in java

Do some investigation and explore whether C# requires that all objects be allocated from the heap and how it approaches type parameterization.

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