# Academic exercise HELP

**URL:** https://discourse.processing.org/t/academic-exercise-help/22130
**Category:** Coding Questions
**Tags:** homework
**Created:** [June 24, 2020, 4:12pm UTC](https://discourse.processing.org/t/academic-exercise-help/22130 "2020-06-24T16:12:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Nikos](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@Nikos](https://discourse.processing.org/u/Nikos)
#### Post date: [June 24, 2020, 4:12pm UTC](https://discourse.processing.org/t/academic-exercise-help/22130/1 "2020-06-24T16:12:58Z")

</div>

Hello! I’m a newbie on processing and I have a question about an academic exercise. I want to make diagonal points with degrading strokeWeight(starting at point 0,0 with the bigger point). I must use this semi completed program :

void setup {  
size(400, 400);  
background(0);  
stroke(255);

if( int y = 400; y \> 0; y-=10) {  
strokeWeight(y\*\_\_\_\_);  
point(y-400, y-400);  
}  
}

I have to fill the parenthesis in strokeWeight.

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [June 24, 2020, 10:59pm UTC](https://discourse.processing.org/t/academic-exercise-help/22130/2 "2020-06-24T22:59:17Z")

</div>

> [@Nikos](#):
>
> I have to fill the parenthesis in strokeWeight.

Fill it in and see what happens!

This will require a bit more work than that.

One of the best tools in a programmers tool chest is knowing the resources available to you and learning to navigate and use them.

This is a very short list:

> **Resources \< Click here to expand !**
>
> I encourage you to review the resources available here:
> 
> - The Processing _website_ has references, examples, tutorials, etc.  
> [https://processing.org/](https://processing.org/)
> - The Processing PDE (IDE) has lots to offer!  
> An exploration of the tabs will reveal what is available; libraries, tools and local examples there.
> - The Coding Train  
> [https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1\_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)  
> [https://thecodingtrain.com/](https://thecodingtrain.com/)
> - Happy Coding  
> [Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)
> - The source code can give insight if you are adventurous:  
> [GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)](https://github.com/processing/processing)  
> Many of the Processing functions are here:  
> [processing/core/src/processing/core/PApplet.java at master · processing/processing · GitHub](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java)
> - The Processing Foundation  
> [https://processingfoundation.org/](https://processingfoundation.org/)  
> Check out the tabs.  
> In the education tab, there is a reference to the Coding Train.
> - And the Internet. `:)`

`:)`

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c8a4e36fe6ea233bbf0f1dcb380b27c6b754ec4e.png)

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [June 24, 2020, 11:09pm UTC](https://discourse.processing.org/t/academic-exercise-help/22130/3 "2020-06-24T23:09:10Z")

</div>

you have to decrement the size in a for loop, also the code block needs to be in draw. Can’t say anymore than that as its an assignment. Good luck.

---

<div class="post-metadata">

### Author: ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)
#### Post date: [June 24, 2020, 11:58pm UTC](https://discourse.processing.org/t/academic-exercise-help/22130/4 "2020-06-24T23:58:45Z")

</div>

You have to try things and observe. It’ll make you feel like a scientist when you get it right.

---

<div class="post-metadata">

### Author: ![slow\_izzm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/slow_izzm/32/5637_2.png) [@slow\_izzm](https://discourse.processing.org/u/slow_izzm)
#### Post date: [June 25, 2020, 12:15am UTC](https://discourse.processing.org/t/academic-exercise-help/22130/5 "2020-06-25T00:15:08Z")

</div>

> [@paulgoux](#):
>
> the code block needs to be in draw

why would the code need to be in `draw()`?

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [June 25, 2020, 12:23am UTC](https://discourse.processing.org/t/academic-exercise-help/22130/6 "2020-06-25T00:23:00Z")

</div>

> [@Nikos](#):
>
> void setup {  
> size(400, 400);  
> background(0);  
> stroke(255);
> 
> if( int y = 400; y \> 0; y-=10) {  
> strokeWeight(y\*\_\_\_\_);  
> point(y-400, y-400);  
> }  
> }

it doesnt, I forgot you can draw straight from setup
