subject

Marching Ants This is a simulation of ants searching around and trying to find some food, moving in seemingly random directions. Implement the following algorithm in processing. You’ll need a for( ) loop to make this work: atx = 250 <-- initial position, set this to the center of your screen anty = 250 <-- same thing Loop 500 times: Old aunty = aunty Old anty = anty Antx = antx + random number from -5 to 5 Anty = anty + random number from -5 to 5 Draw a line from (antx, anty) to (old antx, old anty) If you put your drawing code into a draw( ) function, it will repeatedly draw the marching ants over and over again. It looks kind of messy after you do this so many times! Make it so that you only simulate the marching ants 20 times instead! (hint: you’ll need another loop!) For an extra challenge, can you make the color of the ants random?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
You know the right answer?
Marching Ants This is a simulation of ants searching around and trying to find some food, moving in...
Questions
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Chemistry, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
English, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Biology, 10.09.2020 19:01
question
Social Studies, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
Mathematics, 10.09.2020 19:01
question
World Languages, 10.09.2020 19:01
Questions on the website: 13722367