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, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
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 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
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, 06.03.2020 22:29
question
Health, 06.03.2020 22:29
question
Mathematics, 06.03.2020 22:29
question
Physics, 06.03.2020 22:29
question
Mathematics, 06.03.2020 22:29
Questions on the website: 13722367