Decoding Challenge #1

Posted January 11, 2019 by ilee

Here is the code for Challenge #1:

image

The Challenge

In the comment section below, add your interpretation of this code.  Rather than copying the text of the blocks, tell us in your own words what is happening.

Comments

Submitted by Bob Coulter on Sat, 01/19/2019 - 13:11 · Permalink

It seems that there are two main chunks:

1) Clearing out: Remove agents, reset the terrain to the default, and set the counts back to zero.

2) Create 50 fish and assign attributes such as size, elevation, and energy. With that, they are also scattered around the screen.

Answer

Submitted by Lytle on Sat, 01/19/2019 - 13:13 · Permalink

It is telling the program to clear everything and reset the data boxes to zero.  Then it is saying to create 50 fish.

Different colors and scatter them including on the z axis which is 3D

Answer

Submitted by sgibbs on Sat, 01/19/2019 - 13:13 · Permalink

This setup code seems to reset the world, including the data boxes, and to create 50 anglefish, of different colors.  It scatters them and then also sets their "z" to a random amount.  Finally, it sets their "fish energy" to a random amount between 1-9.

Answer

Submitted by mehagaman on Sat, 01/19/2019 - 13:14 · Permalink

6 word summary:  World Cleared. Fish Made. Scattered, energy.

Answer

Submitted by Kaestner on Sat, 01/19/2019 - 13:15 · Permalink

Fish are being created with random energy levels and scattered randomly from 2-26 in the z direction. Data boxes are set to zero.

Answer

Submitted by jlcordova6 on Sat, 01/19/2019 - 13:15 · Permalink

1.  The world is set to the initial settings, all the same number of agents, and terrain the same.  

2.  Data boxes are cleared to start initial count of agents

3. 50 fish are created with specific traits including energy level

Answer

Submitted by melodeehaskins on Sat, 01/19/2019 - 13:17 · Permalink

i found it! yay!  Clear --> FISH --> scatter 

Answer