We are about to switch to a new forum software. Until then we have removed the registration on this forum.

- All Categories 25.5K
- Announcements & Guidelines 13
- Common Questions 30
- Using Processing 22K
- Programming Questions 12.1K
- Questions about Code 6.3K
- How To... 4.2K
- Hello Processing 72
- GLSL / Shaders 289
- Library Questions 4K
- Hardware, Integration & Other Languages 2.6K
- Kinect 657
- Arduino 1K
- Raspberry PI 183
- Questions about Modes 1.9K
- Android Mode 1.3K
- JavaScript Mode 411
- Python Mode 201
- Questions about Tools 100
- Espanol 5
- Developing Processing 547
- Create & Announce Libraries 211
- Create & Announce Modes 19
- Create & Announce Tools 29
- Summer of Code 2018 92
- Rails Girls Summer of Code 2017 3
- Summer of Code 2017 49
- Summer of Code 2016 4
- Summer of Code 2015 40
- Summer of Code 2014 22
- p5.js 1.5K
- p5.js Programming Questions 937
- p5.js Library Questions 313
- p5.js Development Questions 31
- General 1.4K
- Events & Opportunities 287
- General Discussion 365

Hello! // Hola! I need help, I do not know how to plot the nth triangular number. Here is my code. // Necesito ayuda, no sé cómo graficar el número triangular enésimo. Aquí esta mi código.

```
void nesimotermino(int n){
println((n*(n+1))/2);
}
void nterminos(int n){
int [] array=new int[n+1];
for(int i=0;i<n+1;i++){
array[i]=((i*(i+1))/2);
}
printArray(array);}
void setup(){
println("N-esimo termino de los numeros triangulares");
nesimotermino(n); //replaced by any number n
println("N primeros terminos de los numeros triangulares");
nterminos(n); // replaced by any number n
size(700,700);
}
void draw (){
background(550);
strokeWeight(4);
rectMode(CENTER); //(valor por defecto)
ellipse(350,350,50,50);
}
```

Thanks!! // Gracias

Excuse me. I want to know how to graph any triangular number that is replaced in the console as n. I'm a little confused about where to start. One could draw graph the number as follows:

```
*
**
***
****
```

## Answers

please go back, edit your post

format the code right

http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text#latest

is this homework?

your code does't run - you need

`int n=10;`

do you mean that?

your sketch (if it would work, insert the line with n)

let's say n is 10 and you want to see a graphic for n=10

Excuse me. I want to know how to graph any triangular number that is replaced in the console as n. I'm a little confused about where to start. One could draw graph the number as follows:

yes, see my pseudo code above.

can you write a sketch, starting with my pseudo-code?

Yes, I am doing. Thank you.