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
A virtual function permits derived classes to replace the implementation given by the base class. The compiler makes sure the replacement is always known as whenever the object in

How do you access the values within an array? - Arrays comprise a number of elements, which depends on the size you assigned it during variable declaration. - Every element

P o i n t er s to Members: In C a pointer is created  to locate  the address of another variable  for faster access. Consider the following example. int x, *p; p =

The digital signal is one which only consists of two states i.e. logic '1'   (+5 volts) and logic '0' (0 volts). Various electronic blocks use logic and these form the basis of a m

Need to Fix a code written in c++,SDL2.00 for high CPU and memory leak There is a 2D simple game written with SDL2.00 using c++. The game isn't complete and the code is a little

Q: What are some ways try / catch / throw can develop software quality? A: By removing one of the reasons for if statements. The commonly utilized alternative to try / catch

First line starts with T, number of test cases. Each test case T contains a necklace (N).

write a pseudocode algorithm for a program that accepts a number and prints out its reciprocal(1/n) is required.the program should prevent the user from entering zero by asking t

A skilled programmer is required to build a standalone module to extract, parse and store in database tables, word count data from web pages and RSS feeds. The module can take R

Project Description: We are looking to have software that we will use to track employee information regarding our wellness program. We would like the system to be able to follow