# Please Help me for Text Function ! I am noob

**URL:** https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356
**Category:** Coding Questions
**Tags:** homework
**Created:** [November 11, 2020, 11:24pm UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356 "2020-11-11T23:24:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![AzizurRahman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/azizurrahman/32/11064_2.png) [@AzizurRahman](https://discourse.processing.org/u/AzizurRahman)
#### Post date: [November 11, 2020, 11:24pm UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/1 "2020-11-11T23:24:07Z")

</div>

Hi everyone I am A beginner. I wrote this code so far. And I want make output texts in way so that it is has only 5 column inside the screen and when the output is bigger than width it goes to new line under the previous line. I know I have use a loop function in order to make it work.

my output text is only single digit

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 12, 2020, 2:26am UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/2 "2020-11-12T02:26:31Z")

</div>

So show us your code

---

<div class="post-metadata">

### Author: ![AzizurRahman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/azizurrahman/32/11064_2.png) [@AzizurRahman](https://discourse.processing.org/u/AzizurRahman)
#### Post date: [November 12, 2020, 2:42am UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/3 "2020-11-12T02:42:11Z")

</div>

I want to make the output look like this.

 ![q1 problem](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a20a3f2a256b3146a5dfb08ba3cd173be227a9fc.jpeg)

So how can I change the text function and make such loop so that it can look like the attached picture.  
here is my code:

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 12, 2020, 2:57am UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/4 "2020-11-12T02:57:28Z")

</div>

Every step increase x by 40 or so

When x\>width-40 put x back to 10 or so and increase y by 27 or so

---

<div class="post-metadata">

### Author: ![AzizurRahman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/azizurrahman/32/11064_2.png) [@AzizurRahman](https://discourse.processing.org/u/AzizurRahman)
#### Post date: [November 12, 2020, 3:02am UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/5 "2020-11-12T03:02:28Z")

</div>

I already tried that. Besides it should not happen because the x will never be greater than width it will always starts from 30.  
As an example even if you enter that want 25 numbers that starting point of x will be 30.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 12, 2020, 8:39am UTC](https://discourse.processing.org/t/please-help-me-for-text-function-i-am-noob/25356/6 "2020-11-12T08:39:46Z")

</div>

My advice is still valid.

- The x moves right and at the end of the line you increase y and set x back to 30.

You have to adjust the values like 30 or 40 of course.

(From what I saw, your } was to soon in the code by the way.)

Chrisir

Here is what I mean with x and y:

```auto

int x=30, y=50; 

void setup() {
  size(1000, 1000);
  textSize(40);
  background(170);
  frameRate(33);
}

void draw() {  
  text( "A", x, y);

  x += 70; // move right 

  if (x>width-110) {
    // new line !!!
    x=30; 
    y += 50;
  } // if
}
//

```
