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
Aim: To implement a program to find area of rectangle, surface area of box and volume of box using virtual functions. Code:                       class rect {

color representation 0,1,2,3,4,5,6,7...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

submitting solutions in C language should not use functions from / as these files do not exist in gcc

What is the difference between = symbol and == symbol? - The = symbol is generally used in mathematical operations. It's used to assign a value to a given variable whereas the

The Scope Resolution Operator( :: ) Global variables are explained outside any functions and thus can be used by all the functions defined thereafter. However, if a global vari

Lennie McPherson, proprietor of Lennie''''s Bail Bonds, needs to calculate the amount due for setting the bail. Lennie requires something of value as collateral, and his fee is 10%

Requirements: 1.  This assignment as well as other assignments in this class must be finished on Windows operating system. 2.  Zip your program and submit the zip file on ANG

Can I drop the [] while deleteing array of some built-in type (char, int, etc)? A: No. you can't Sometimes programmers think that the [] in the delete[] p only present so the

Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea