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

- All Categories 25.7K
- Announcements & Guidelines 13
- Common Questions 30
- Using Processing 22.1K
- Programming Questions 12.2K
- Questions about Code 6.4K
- How To... 4.2K
- Hello Processing 72
- GLSL / Shaders 292
- Library Questions 4K
- Hardware, Integration & Other Languages 2.7K
- Kinect 661
- Arduino 1K
- Raspberry PI 187
- Questions about Modes 2K
- Android Mode 1.3K
- JavaScript Mode 413
- Python Mode 205
- Questions about Tools 101
- Espanol 5
- Developing Processing 548
- Create & Announce Libraries 211
- Create & Announce Modes 19
- Create & Announce Tools 29
- Summer of Code 2018 93
- 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.6K
- p5.js Programming Questions 947
- p5.js Library Questions 315
- p5.js Development Questions 31
- General 1.4K
- Events & Opportunities 289
- 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.