# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=76

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 77

---

## [Copying ArrayLists without affecting original](https://discourse.processing.org/t/copying-arraylists-without-affecting-original/24820)

<div class="topic-metadata">

**Author:** [@arcadeperfect](https://discourse.processing.org/u/arcadeperfect)\
**Replies:** 2\
**Last updated:** [October 22, 2020, 1:37pm UTC](https://discourse.processing.org/t/copying-arraylists-without-affecting-original/24820 "2020-10-22T13:37:10Z")

</div>

Hi, Is there a way to create a new copy of an ArrayList full of custom classes (in case it’s relevant), such that modifications to the objects in the new list will not affect the originals? Failing that, is there a way…

---

## [How do I make these rows and columns (csv to grid) work?](https://discourse.processing.org/t/how-do-i-make-these-rows-and-columns-csv-to-grid-work/24818)

<div class="topic-metadata">

**Author:** [@JennyMcCreadie](https://discourse.processing.org/u/JennyMcCreadie)\
**Replies:** 1\
**Last updated:** [October 22, 2020, 12:44pm UTC](https://discourse.processing.org/t/how-do-i-make-these-rows-and-columns-csv-to-grid-work/24818 "2020-10-22T12:44:34Z")

</div>

Hello, I’m trying to make a grid that looks a bit like this photo, except I’m using different data which corresponds to the days of the year. I’ve noticed it works if I use something like “int rows = 10; int cols = 5;” …

---

## [Draw a Pyramid with for-loop and with rect](https://discourse.processing.org/t/draw-a-pyramid-with-for-loop-and-with-rect/24751)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 5\
**Last updated:** [October 20, 2020, 9:07pm UTC](https://discourse.processing.org/t/draw-a-pyramid-with-for-loop-and-with-rect/24751 "2020-10-20T21:07:36Z")

</div>

Hello, I’m trying to get a pyramid with a for loop. It has to start at the middle with a rect like in my code (but there are 2 rects actually idk why) and then go down on both sides step by step but i’m really confused …

---

## [Why isn't my code working when it's the exact same as my tutors?](https://discourse.processing.org/t/why-isnt-my-code-working-when-its-the-exact-same-as-my-tutors/24813)

<div class="topic-metadata">

**Author:** [@JennyMcCreadie](https://discourse.processing.org/u/JennyMcCreadie)\
**Replies:** 9\
**Last updated:** [October 22, 2020, 10:09am UTC](https://discourse.processing.org/t/why-isnt-my-code-working-when-its-the-exact-same-as-my-tutors/24813 "2020-10-22T10:09:05Z")

</div>

Hello, I’m following a tutorial from my tutor and it’s just the start so he made a mistake on purpose for all of the ellipses to fall in to the top left (so that’s not the issue here) but whenever I try to do the exact s…

---

## [Import a lot of svg](https://discourse.processing.org/t/import-a-lot-of-svg/24805)

<div class="topic-metadata">

**Author:** [@Dimdimtri](https://discourse.processing.org/u/Dimdimtri)\
**Replies:** 4\
**Last updated:** [October 22, 2020, 9:08am UTC](https://discourse.processing.org/t/import-a-lot-of-svg/24805 "2020-10-22T09:08:42Z")

</div>

Hi everyone, I wanted to know if there is a solution to import a lot of svg at the same time. they are all in the same folder. I have like 100 and I can’t see myself writing “PShape bot, bot2, bot3 …;” Because I wanted …

---

## [Trying to ensure that one item spawns at a time](https://discourse.processing.org/t/trying-to-ensure-that-one-item-spawns-at-a-time/24745)

<div class="topic-metadata">

**Author:** [@jxjohn](https://discourse.processing.org/u/jxjohn)\
**Replies:** 4\
**Last updated:** [October 21, 2020, 10:46am UTC](https://discourse.processing.org/t/trying-to-ensure-that-one-item-spawns-at-a-time/24745 "2020-10-21T10:46:05Z")

</div>

Hi, I’m trying to say when an enemy disappear from the screen it will move from 1 array to the next while maintaining the previous shape it has already drew. However, whenever I run the code it seems to draw all the arra…

---

## [How to put an array of images inside a function?](https://discourse.processing.org/t/how-to-put-an-array-of-images-inside-a-function/24379)

<div class="topic-metadata">

**Author:** [@tea](https://discourse.processing.org/u/tea)\
**Replies:** 27\
**Last updated:** [October 21, 2020, 6:51am UTC](https://discourse.processing.org/t/how-to-put-an-array-of-images-inside-a-function/24379 "2020-10-21T06:51:37Z")

</div>

So I’m writing a Super Mario/platform game for school, and I’m trying to make a hand-drawn character move around the screen, in three modes: Idle: just standing, default mode if no key is pressed Running: when right or…

---

## [Image doesn't show](https://discourse.processing.org/t/image-doesnt-show/24693)

<div class="topic-metadata">

**Author:** [@lukeltw](https://discourse.processing.org/u/lukeltw)\
**Replies:** 7\
**Last updated:** [October 20, 2020, 6:41pm UTC](https://discourse.processing.org/t/image-doesnt-show/24693 "2020-10-20T18:41:08Z")

</div>

Can someone tell me where is wrong? I am a new programmer, I try to run my code, then I got this: The file “psa.jpg” is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch…

---

## [Making shape disappear in a specific area](https://discourse.processing.org/t/making-shape-disappear-in-a-specific-area/24749)

<div class="topic-metadata">

**Author:** [@karbon](https://discourse.processing.org/u/karbon)\
**Replies:** 1\
**Last updated:** [October 20, 2020, 4:44pm UTC](https://discourse.processing.org/t/making-shape-disappear-in-a-specific-area/24749 "2020-10-20T16:44:43Z")

</div>

I am trying to make a shape disappear once it is released in a certain area of the window. I am unsure how I should look at the problem to make it work. I couldn’t find examples that were interactivity based. All the one…

---

## [Trying to create random circle that does not overlap](https://discourse.processing.org/t/trying-to-create-random-circle-that-does-not-overlap/24637)

<div class="topic-metadata">

**Author:** [@jxjohn](https://discourse.processing.org/u/jxjohn)\
**Replies:** 25\
**Last updated:** [October 20, 2020, 3:41pm UTC](https://discourse.processing.org/t/trying-to-create-random-circle-that-does-not-overlap/24637 "2020-10-20T15:41:29Z")

</div>

Hi I’m trying to create random circles which do not overlap. I have seen a few videos on the net but they do not specifically use array to solve the question. Is there any way to do it? Below is the code I have tried ou…

---

## [When one of the images pops up, the others are invisible](https://discourse.processing.org/t/when-one-of-the-images-pops-up-the-others-are-invisible/24748)

<div class="topic-metadata">

**Author:** [@seoha](https://discourse.processing.org/u/seoha)\
**Replies:** 2\
**Last updated:** [October 20, 2020, 1:34pm UTC](https://discourse.processing.org/t/when-one-of-the-images-pops-up-the-others-are-invisible/24748 "2020-10-20T13:34:47Z")

</div>

Hello🤗 I want to make three images change one by one depending on the situation. How should I make them? Can you help me?:joy:

---

## [Working with 2D arrays](https://discourse.processing.org/t/working-with-2d-arrays/24683)

<div class="topic-metadata">

**Author:** [@thughes](https://discourse.processing.org/u/thughes)\
**Replies:** 11\
**Last updated:** [October 20, 2020, 11:23am UTC](https://discourse.processing.org/t/working-with-2d-arrays/24683 "2020-10-20T11:23:18Z")

</div>

Can someone help me find out what I am doing wrong? Why is it not showing my green square? \*\*\*\*Move it as the first if statement that is checked.( I moved to to the beginning of draw….) The other two statements shoul…

---

## [Help me program how to win in tic tac toe](https://discourse.processing.org/t/help-me-program-how-to-win-in-tic-tac-toe/24340)

<div class="topic-metadata">

**Author:** [@Cal\_codes](https://discourse.processing.org/u/Cal_codes)\
**Replies:** 5\
**Last updated:** [October 5, 2020, 5:18pm UTC](https://discourse.processing.org/t/help-me-program-how-to-win-in-tic-tac-toe/24340 "2020-10-05T17:18:29Z")

</div>

please format code with \</\> button \* homework policy \* asking questions //A simple tic tac toe by Caleigh Esterhuyse Grid grid; int numMoves = 9; int column, row; boolean player1Playing = true; int moves = new i…

---

## [Rectangle coding help](https://discourse.processing.org/t/rectangle-coding-help/24687)

<div class="topic-metadata">

**Author:** [@rk0945](https://discourse.processing.org/u/rk0945)\
**Replies:** 4\
**Last updated:** [October 19, 2020, 10:06am UTC](https://discourse.processing.org/t/rectangle-coding-help/24687 "2020-10-19T10:06:53Z")

</div>

int numRows; int rowColumns; int rowLength; int startX; int startY; int rectWidth; int rectHeight; boolean isColour; void setup () { size (900, 400); stroke (0); numRows = 1; rowColumns = 1; rowLength = 10;…

---

## [Code to integrate profile ICC for PGraphicsPDF](https://discourse.processing.org/t/code-to-integrate-profile-icc-for-pgraphicspdf/24703)

<div class="topic-metadata">

**Author:** [@Claude-CLd1](https://discourse.processing.org/u/Claude-CLd1)\
**Replies:** 0\
**Last updated:** [October 19, 2020, 10:03am UTC](https://discourse.processing.org/t/code-to-integrate-profile-icc-for-pgraphicspdf/24703 "2020-10-19T10:03:15Z")

</div>

Hello, do you know how I can include an ICC profile inside the PDF file generated by PGraphicsPDF. Thank you for your help.

---

## [Comment intégrer un profil ICC pour PGraphicsPDF](https://discourse.processing.org/t/comment-integrer-un-profil-icc-pour-pgraphicspdf/24701)

<div class="topic-metadata">

**Author:** [@Claude-CLd1](https://discourse.processing.org/u/Claude-CLd1)\
**Replies:** 0\
**Last updated:** [October 19, 2020, 10:00am UTC](https://discourse.processing.org/t/comment-integrer-un-profil-icc-pour-pgraphicspdf/24701 "2020-10-19T10:00:56Z")

</div>

Bonjour, savez-vous comment inclure un profil ICC dans le fichier PDF créé avec PGraphicsPDF. Merci de votre aide

---

## [How to get text(); vertical](https://discourse.processing.org/t/how-to-get-text-vertical/24685)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 2\
**Last updated:** [October 18, 2020, 9:21pm UTC](https://discourse.processing.org/t/how-to-get-text-vertical/24685 "2020-10-18T21:21:17Z")

</div>

How do I get the numbers vertical? Starting from 0 down to 9 char alphabet = 'a'; char nextChar; float chatX = 20; int spacing; char neuChar; float chaX = 20; char alp = 'Z'; char zahlenChar; float chaXX = 5; char cou…

---

## [Ellipse diameter depending on mouse position](https://discourse.processing.org/t/ellipse-diameter-depending-on-mouse-position/24678)

<div class="topic-metadata">

**Author:** [@mdhasan6230](https://discourse.processing.org/u/mdhasan6230)\
**Replies:** 6\
**Last updated:** [October 18, 2020, 8:51pm UTC](https://discourse.processing.org/t/ellipse-diameter-depending-on-mouse-position/24678 "2020-10-18T20:51:20Z")

</div>

i need help drawing an ellipse that’s diameter will depend on the mouse moving position… like when the y position increase and the x position decrease the diameter will in increase and vise versa… plus the ellipse shoul…

---

## [How to get space between the displayed letters](https://discourse.processing.org/t/how-to-get-space-between-the-displayed-letters/24682)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 2\
**Last updated:** [October 18, 2020, 7:36pm UTC](https://discourse.processing.org/t/how-to-get-space-between-the-displayed-letters/24682 "2020-10-18T19:36:06Z")

</div>

Hello, some of the letters are above other letters. How to get one letter behind another letter without overlapping? Thanks in advance! char alphabet = 'a'; char nextChar; float chatX = 20; int spacing; void setup()…

---

## [Pdf export settings](https://discourse.processing.org/t/pdf-export-settings/24659)

<div class="topic-metadata">

**Author:** [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Replies:** 0\
**Last updated:** [October 17, 2020, 4:48pm UTC](https://discourse.processing.org/t/pdf-export-settings/24659 "2020-10-17T16:48:38Z")

</div>

Do somebody know if it is possible to set otions while saving a pdf file with Processing’s dedicated library ? For instance I’d like to decide the jpeg quality.

---

## [Problems with loadImage("ran.png"); in processing 4.02a](https://discourse.processing.org/t/problems-with-loadimage-ran-png-in-processing-4-02a/24652)

<div class="topic-metadata">

**Author:** [@x13420x](https://discourse.processing.org/u/x13420x)\
**Replies:** 4\
**Last updated:** [October 18, 2020, 1:12am UTC](https://discourse.processing.org/t/problems-with-loadimage-ran-png-in-processing-4-02a/24652 "2020-10-18T01:12:56Z")

</div>

\<PImage paint; paint = loadImage(“ericarose.png”); \> getting back a null pointer exception worked fine in 4.01a

---

## [Shapes inside shapes](https://discourse.processing.org/t/shapes-inside-shapes/24665)

<div class="topic-metadata">

**Author:** [@charmypatel](https://discourse.processing.org/u/charmypatel)\
**Replies:** 1\
**Last updated:** [October 18, 2020, 12:34am UTC](https://discourse.processing.org/t/shapes-inside-shapes/24665 "2020-10-18T00:34:24Z")

</div>

Haven’t touched Processing in a while so need to refresh some things. I have these 2 circles that I’m trying to use as eyes for an animal. Is it possible to put shapes inside shapes? I want to add more circles within the…

---

## [Can someone help me convert this code from normal array\[\] to ArrayList](https://discourse.processing.org/t/can-someone-help-me-convert-this-code-from-normal-array-to-arraylist/24651)

<div class="topic-metadata">

**Author:** [@HumanoidX](https://discourse.processing.org/u/HumanoidX)\
**Replies:** 2\
**Last updated:** [October 18, 2020, 12:26am UTC](https://discourse.processing.org/t/can-someone-help-me-convert-this-code-from-normal-array-to-arraylist/24651 "2020-10-18T00:26:56Z")

</div>

When I tried to convert it to ArrayList code, it don’t work anymore. float fadeSpeed = 20; float mouseStrength = 100; float windStrength = 0.1; float gravityStrength = 0.2; int circleAmount = 12; Circle\[\] circles = n…

---

## [How to load an image without function image();](https://discourse.processing.org/t/how-to-load-an-image-without-function-image/24566)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 11\
**Last updated:** [October 17, 2020, 8:08pm UTC](https://discourse.processing.org/t/how-to-load-an-image-without-function-image/24566 "2020-10-17T20:08:56Z")

</div>

Hello, I have to get an europe-map image to the sketch-window by clicking the key l or L but without saving the picture and without using the function image(); I tried it like this but it’s not working. Maybe there is …

---

## [Help with making a calculator](https://discourse.processing.org/t/help-with-making-a-calculator/24631)

<div class="topic-metadata">

**Author:** [@yaboi999](https://discourse.processing.org/u/yaboi999)\
**Replies:** 4\
**Last updated:** [October 17, 2020, 3:50pm UTC](https://discourse.processing.org/t/help-with-making-a-calculator/24631 "2020-10-17T15:50:35Z")

</div>

Hello, I need help finishing my calculator. Unfortunatey the teacher has not been much help, and I have struggled with this for two and a half weeks now. This is my code. I will attach my flowchart as well. Please help…

---

## [Help with drawing a "rose" that draws each "petal" with a different random color](https://discourse.processing.org/t/help-with-drawing-a-rose-that-draws-each-petal-with-a-different-random-color/24654)

<div class="topic-metadata">

**Author:** [@kimchi](https://discourse.processing.org/u/kimchi)\
**Replies:** 3\
**Last updated:** [October 17, 2020, 11:26am UTC](https://discourse.processing.org/t/help-with-drawing-a-rose-that-draws-each-petal-with-a-different-random-color/24654 "2020-10-17T11:26:41Z")

</div>

Hi I need some help on this one program that draws a mathematical rose where it draws each petal of the rose as a different random color. When I run my code it only draws half of each petal as a random color and the othe…

---

## [Change scale based on position y](https://discourse.processing.org/t/change-scale-based-on-position-y/24635)

<div class="topic-metadata">

**Author:** [@ljna227](https://discourse.processing.org/u/ljna227)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 10:59am UTC](https://discourse.processing.org/t/change-scale-based-on-position-y/24635 "2020-10-16T10:59:47Z")

</div>

I managed to make trees pop up in random locations on the screen. But I have to change the scale based on the y position of the trees. As the tree pop up lower in the screen, it should be bigger and fewer compared to the…

---

## [Need help for animating pixels like in this video](https://discourse.processing.org/t/need-help-for-animating-pixels-like-in-this-video/24628)

<div class="topic-metadata">

**Author:** [@Iden](https://discourse.processing.org/u/Iden)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 1:14am UTC](https://discourse.processing.org/t/need-help-for-animating-pixels-like-in-this-video/24628 "2020-10-16T01:14:16Z")

</div>

Hello guys ! I’m a beginner and I would need help with doing those animations in processing. I do not want to implement them in a real objectif (such as glasses) but I’m just really curious and motived about how I could …

---

## [Text editor base?](https://discourse.processing.org/t/text-editor-base/23822)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 25\
**Last updated:** [October 15, 2020, 10:52am UTC](https://discourse.processing.org/t/text-editor-base/23822 "2020-10-15T10:52:16Z")

</div>

Hey! So I’m trying to make a text editor in processing something similar to Notepad++ but simpler. Here is what I got so far: PFont font; PImage save; PImage open; PImage brush; color theme1 = color(0, 8, 48); color t…

---

## [How to remove a specific object from an Arraylist](https://discourse.processing.org/t/how-to-remove-a-specific-object-from-an-arraylist/24599)

<div class="topic-metadata">

**Author:** [@Ohli](https://discourse.processing.org/u/Ohli)\
**Replies:** 8\
**Last updated:** [October 15, 2020, 10:48am UTC](https://discourse.processing.org/t/how-to-remove-a-specific-object-from-an-arraylist/24599 "2020-10-15T10:48:43Z")

</div>

I am working on a project for a beginner programming course. I am making a simple game where a vacuum character needs to collect small brown circles (rubbish) by moving over them and using a suction device, whilst avoidi…

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=75)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=77)
