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

Assignment Help:

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.


Related Discussions:- Program to spider''s path display to the screen

Compass bearing, write a c program that converts compass bearings into dire...

write a c program that converts compass bearings into direction

C program to define power of a function, C program to define power of a fun...

C program to define power of a function: Write a program to use power of a function. void main() { int x,y,po=1,i,j; clrscr();   printf("Give x,y\n"); sca

PROGRAM, TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET

TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET

Application for tag in the forest game, Your program should use the Free Pa...

Your program should use the Free Pascal compiler or the Lazarus IDE described in CSC 540. When you hand in your assignment to the digital dropbox, it should be a .PAS file, not zip

#Luminous Jewels, #Byteland county is very famous for luminous jewels. Lumi...

#Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Ne

Result system, write a promgram using object oriented peramid

write a promgram using object oriented peramid

AREA UNDER CURVE, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Define difference among delete and delete[]?, when you allocate memory with...

when you allocate memory with new[], you ought to free the memory via delete[]. While you allocate memory along 'new', then use 'delete' with no the brackets. You employ new[] to a

Tranporsition cipher, write a C program that can display the transpose form...

write a C program that can display the transpose form of a ciphertext matrix.

Convert coordinate - c++ program, Convert coordinate: class rect{  ...

Convert coordinate: class rect{                 private :                 float  x,y;                   public :                 void  input()

Write Your Message!

Captcha
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