Program to spider''s path display to the screen, C/C++ Programming

Spider webs have two types of silk, sticky silk and strength silk, spiders do not move on the sticky silken threads only on the strength threads. Assume one type of spider creates webs such that the strength silks radiate form the center like bicycle spokes and the sticky threads are like concentric circles.

The strength webs are numbers 0 through n  in a clockwise fashion, starting at the "12 o'clock" position, these webs are equally spaced, the sticky webs are designated by sequential letters of the alphabet starting with A on the inner most circle. Write a code that accepts user input for the number of strength webs and a number of sticky webs and the number of flies that have been trapped. Generate the web then place the spider as shown (no graphics required). Randomly place the flies on the web. Have  your spider's path display to the screen. If the fly is closer to one strength web or the other then that should be the spider's  destination, else  it does not matter. Once a fly  is captured then the spider should travel to the next fly until all are captured.

Sample run: Input> 8

Input>  4

Input >I

Spider at  7, 0

Fly F  near 4, D.

(8 strength webs) (4 sticky circles) (1 fly)

(meaning it is on strand 7 but outside the sticky webs)

Spider travels to 7, D Spider travels to 7, C Spider travels to 7, B Spider travels to 7, A Spider travels to center Spider travels to 4, A Spider travels to 4, B Spider travels to 4, C Spider travels to 4, D Fly captured.

Posted Date: 3/12/2013 1:38:31 AM | Location : United States







Related Discussions:- Program to spider''s path display to the screen, Assignment Help, Ask Question on Program to spider''s path display to the screen, Get Answer, Expert's Help, Program to spider''s path display to the screen Discussions

Write discussion on Program to spider''s path display to the screen
Your posts are moderated
Related Questions
Hi, I want to get rtsp source for windows

Write a program that displays the following temperature conversion chart on the screen as follows below. Hint: c = 5.0/9.0 * (f - 2) C = degrees in Celsius F = degree in F

What do you mean by a sequential access file? - When writing programs which store and retrieve data in a file, it's possible to designate that file into various forms. - A s

Write a c++ program to find the sum of 0.123 ? 103 and 0.456 ? 102 and write the result in three significant digits.

Question 1 Create a class String which stores a string value. Overload ++ operator which converts the characters of the string to uppercase (toupper() library function of "ctype.h

Write a program called A1Q3, that reads it the radius of a circle as an integer and prints the circle's diameter, circumference and area.  Use a constant value for pi.  Do all calc

#include int main() { int T; int N; int i; scanf("%d",&T)

Scope Rules and Storage Classes The storage class verifies the life of a variable in terms of its duration or its scope. There are four storage classes : automatic static

Consider a group of n robots, numbered R2D1 through R2Dn, and m tasks, numbered 1 through m. Tasks can be different and robots are specialized, hence a given robot can only perform

Develop a C++ program that uses a while to determine the gross pay (in Dollars) for each of several employees. The company pays “straight-time” for the first 40 hours worked by eac