# Coding Questions

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

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

**Page:** 57

---

## [Virtual Keypad Made and Read in the same sketch](https://discourse.processing.org/t/virtual-keypad-made-and-read-in-the-same-sketch/29290)

<div class="topic-metadata">

**Author:** [@edgee](https://discourse.processing.org/u/edgee)\
**Replies:** 1\
**Last updated:** [April 12, 2021, 1:03am UTC](https://discourse.processing.org/t/virtual-keypad-made-and-read-in-the-same-sketch/29290 "2021-04-12T01:03:44Z")

</div>

Hi, I have a project that will have processing program running on an SBC with a touch panel. on one of the GUI screens, values need to be entered in a field. I created a numpad on the screen using ControlP5. for the la…

---

## [Printing console output](https://discourse.processing.org/t/printing-console-output/29279)

<div class="topic-metadata">

**Author:** [@Th3cG](https://discourse.processing.org/u/Th3cG)\
**Replies:** 5\
**Last updated:** [April 11, 2021, 5:42pm UTC](https://discourse.processing.org/t/printing-console-output/29279 "2021-04-11T17:42:40Z")

</div>

Hello, I’m trying to build a small sketch asking a website some weather data. Unfortunately, the site I’m asking data to throws back a 403 error and Processing seems not able to work. So I tried in this way, editing som…

---

## [Create jar file from sketch in java](https://discourse.processing.org/t/create-jar-file-from-sketch-in-java/29267)

<div class="topic-metadata">

**Author:** [@cocconat](https://discourse.processing.org/u/cocconat)\
**Replies:** 3\
**Last updated:** [April 11, 2021, 3:51pm UTC](https://discourse.processing.org/t/create-jar-file-from-sketch-in-java/29267 "2021-04-11T15:51:30Z")

</div>

Hi, I am trying to pack this into a JAR file with IntelliJ IDEA (I can also change IDE if needed, but I d rather stick to this). The project runs in the IDE if I run the file. Honestly, I don’t really know which is the…

---

## [Linear color lerp with three colors](https://discourse.processing.org/t/linear-color-lerp-with-three-colors/29269)

<div class="topic-metadata">

**Author:** [@jaspervb](https://discourse.processing.org/u/jaspervb)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 10:44pm UTC](https://discourse.processing.org/t/linear-color-lerp-with-three-colors/29269 "2021-04-10T22:44:31Z")

</div>

Hi There, I Want to make a linear color lerp with three colors. I already figured out how to make a lerp with just two colors. Is there someone who can help me to make a ‘lerpColor()’ with three separete color values? T…

---

## [Resize shapes random](https://discourse.processing.org/t/resize-shapes-random/29265)

<div class="topic-metadata">

**Author:** [@Panda](https://discourse.processing.org/u/Panda)\
**Replies:** 1\
**Last updated:** [April 10, 2021, 7:59pm UTC](https://discourse.processing.org/t/resize-shapes-random/29265 "2021-04-10T19:59:19Z")

</div>

Is there a way to randomly resize shapes that are repeating? I have a simple window full of repeating rect(). Is there a way to throw in a random option, so that each repetition is randomly shrunk or enlarged? (Thus, ra…

---

## [Draw Order Issue - For Loop and ellipses](https://discourse.processing.org/t/draw-order-issue-for-loop-and-ellipses/29258)

<div class="topic-metadata">

**Author:** [@akathewb](https://discourse.processing.org/u/akathewb)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 7:41am UTC](https://discourse.processing.org/t/draw-order-issue-for-loop-and-ellipses/29258 "2021-04-10T07:41:48Z")

</div>

In the code below I’d like the ellipses to draw on top of the code being run in the for loops, but for some reason they keep drawing before, and I’m not sure how to fix it. Thanks for taking a look. //color variables co…

---

## [Reset the game of bursting ballons](https://discourse.processing.org/t/reset-the-game-of-bursting-ballons/29238)

<div class="topic-metadata">

**Author:** [@ashk](https://discourse.processing.org/u/ashk)\
**Replies:** 5\
**Last updated:** [April 10, 2021, 2:26am UTC](https://discourse.processing.org/t/reset-the-game-of-bursting-ballons/29238 "2021-04-10T02:26:38Z")

</div>

How could i reset and restart game with a key or button after gameover is displayed? float x = 0; float y = 0; float dim = 50.0; float xim = 90.0; float start = PI; float stop = TWO\_PI; float angle = 0; float s; …

---

## [How to show the objects when the ball hits left and right side wall](https://discourse.processing.org/t/how-to-show-the-objects-when-the-ball-hits-left-and-right-side-wall/29252)

<div class="topic-metadata">

**Author:** [@pou5678](https://discourse.processing.org/u/pou5678)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 10:14pm UTC](https://discourse.processing.org/t/how-to-show-the-objects-when-the-ball-hits-left-and-right-side-wall/29252 "2021-04-09T22:14:27Z")

</div>

I tried to do to fix this issue, but it didn’t work well… :/… You know this example is bouncing ball and I want to show the obstacle until ball hits obstacle. I want to get some help to solve. :)… (The problem is this c…

---

## [Periodicity of perlin noise](https://discourse.processing.org/t/periodicity-of-perlin-noise/29245)

<div class="topic-metadata">

**Author:** [@Leoperix03](https://discourse.processing.org/u/Leoperix03)\
**Replies:** 3\
**Last updated:** [April 9, 2021, 8:09pm UTC](https://discourse.processing.org/t/periodicity-of-perlin-noise/29245 "2021-04-09T20:09:14Z")

</div>

Hey everyone, I created a grid of nodes (every node is a class) and every node has its own color, the problem is that I tried to randomize each node\_color with noise() function, the problem though is that when I scroll t…

---

## [Pixel window setup](https://discourse.processing.org/t/pixel-window-setup/26136)

<div class="topic-metadata">

**Author:** [@humus](https://discourse.processing.org/u/humus)\
**Replies:** 10\
**Last updated:** [April 9, 2021, 3:17pm UTC](https://discourse.processing.org/t/pixel-window-setup/26136 "2021-04-09T15:17:49Z")

</div>

Hi, I would like to setup a display with CMYK colors chosen randomly every time by Processing (see the exemple in attach but I need one with one colour per pixel and not group of pixels per colour as in the image attach…

---

## [How do I find a maximum number of consecutive non-zero values in the array?](https://discourse.processing.org/t/how-do-i-find-a-maximum-number-of-consecutive-non-zero-values-in-the-array/29200)

<div class="topic-metadata">

**Author:** [@batmm](https://discourse.processing.org/u/batmm)\
**Replies:** 20\
**Last updated:** [April 9, 2021, 1:00am UTC](https://discourse.processing.org/t/how-do-i-find-a-maximum-number-of-consecutive-non-zero-values-in-the-array/29200 "2021-04-09T01:00:10Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I am going to write a function that accept an array of integers(the frequency of number). In this function, I need to return a maximum number of…

---

## [Shapes 4x4 screen location](https://discourse.processing.org/t/shapes-4x4-screen-location/29186)

<div class="topic-metadata">

**Author:** [@Waller](https://discourse.processing.org/u/Waller)\
**Replies:** 6\
**Last updated:** [April 8, 2021, 5:55pm UTC](https://discourse.processing.org/t/shapes-4x4-screen-location/29186 "2021-04-08T17:55:40Z")

</div>

Hey there, everyone! I’m pretty new to Processing and I’m having a hard time locating shapes on the screen. TASK Create 16 shapes, laying 4x4 on screen, filled with random colors and value of vertex of each next shape…

---

## [Select all boolean variables in one keyword](https://discourse.processing.org/t/select-all-boolean-variables-in-one-keyword/28908)

<div class="topic-metadata">

**Author:** [@freddukas](https://discourse.processing.org/u/freddukas)\
**Replies:** 3\
**Last updated:** [April 7, 2021, 6:49pm UTC](https://discourse.processing.org/t/select-all-boolean-variables-in-one-keyword/28908 "2021-04-07T18:49:53Z")

</div>

hello everyone. is there a trick or a solution to interact with all boolean variables in one keyword ? I hope something like " all.boolean == true" . I think I already saw something like this but I can’t remember exac…

---

## [Random boolean values](https://discourse.processing.org/t/random-boolean-values/29191)

<div class="topic-metadata">

**Author:** [@freddukas](https://discourse.processing.org/u/freddukas)\
**Replies:** 4\
**Last updated:** [April 7, 2021, 5:50pm UTC](https://discourse.processing.org/t/random-boolean-values/29191 "2021-04-07T17:50:12Z")

</div>

Hello, everyone. I need some random boolean variables to be changed in my draw fonction Do i have a way to code a boolean variable randomly change ? Thanks a lot

---

## [Tower Hanoi - Why recursive draw only first and last steps?](https://discourse.processing.org/t/tower-hanoi-why-recursive-draw-only-first-and-last-steps/28923)

<div class="topic-metadata">

**Author:** [@dyehuda](https://discourse.processing.org/u/dyehuda)\
**Replies:** 4\
**Last updated:** [April 7, 2021, 3:07pm UTC](https://discourse.processing.org/t/tower-hanoi-why-recursive-draw-only-first-and-last-steps/28923 "2021-04-07T15:07:39Z")

</div>

please format code with \</\> button \* homework policy \* asking questions int h=50; int w=100; int size=3; int flag=0; int\[\]\[\] Array = { {1,2,3}, {0,0,0}, {0,0,0 } }; int\[\] Top={ 0, -1, 2, 2}; void setup() { size(1200,…

---

## [Jittery Collision Bug](https://discourse.processing.org/t/jittery-collision-bug/29181)

<div class="topic-metadata">

**Author:** [@Tasperen](https://discourse.processing.org/u/Tasperen)\
**Replies:** 0\
**Last updated:** [April 7, 2021, 10:25am UTC](https://discourse.processing.org/t/jittery-collision-bug/29181 "2021-04-07T10:25:05Z")

</div>

I’m getting a Jitter effect on my collision system. I have a guess but not completely sure. I’ve been researching collisions for a month now and finally got my code working with a very basic solution. Unfortunately, with…

---

## [Rotate and flipY axis of multiple RGBpixels images](https://discourse.processing.org/t/rotate-and-flipy-axis-of-multiple-rgbpixels-images/27445)

<div class="topic-metadata">

**Author:** [@ashk](https://discourse.processing.org/u/ashk)\
**Replies:** 3\
**Last updated:** [April 6, 2021, 11:58pm UTC](https://discourse.processing.org/t/rotate-and-flipy-axis-of-multiple-rgbpixels-images/27445 "2021-04-06T23:58:58Z")

</div>

\< I have created 4 images from pixels in a grid format. I want to flip two images in x and y axis. Rotate one image on its own places and keep one as it is. Please help. PImage source, imgFlipxaxis, imgFlipyaxis, imgFl…

---

## [Processing examples: Reach2](https://discourse.processing.org/t/processing-examples-reach2/29143)

<div class="topic-metadata">

**Author:** [@pokelan](https://discourse.processing.org/u/pokelan)\
**Replies:** 4\
**Last updated:** [April 6, 2021, 10:15pm UTC](https://discourse.processing.org/t/processing-examples-reach2/29143 "2021-04-06T22:15:08Z")

</div>

Hi all I am trying to understand this Processing example: https://processing.org/examples/reach2.html And some parts confuse me. reachSegment(0, mouseX, mouseY); for(int i=1; i\<numSegments; i++) { reachSegment(…

---

## [Creating screen boundaries](https://discourse.processing.org/t/creating-screen-boundaries/28855)

<div class="topic-metadata">

**Author:** [@NewProgrammer123](https://discourse.processing.org/u/NewProgrammer123)\
**Replies:** 22\
**Last updated:** [April 6, 2021, 6:30pm UTC](https://discourse.processing.org/t/creating-screen-boundaries/28855 "2021-04-06T18:30:41Z")

</div>

Hello, I am making a simple game but as a beginner I cannot find a way to do the following. It a moving square but I want to write an IF statement so that when it hits the edge of the window for the game to restart. I al…

---

## [Basic word cloud without overlapping](https://discourse.processing.org/t/basic-word-cloud-without-overlapping/26316)

<div class="topic-metadata">

**Author:** [@mloiz](https://discourse.processing.org/u/mloiz)\
**Replies:** 4\
**Last updated:** [April 6, 2021, 1:06pm UTC](https://discourse.processing.org/t/basic-word-cloud-without-overlapping/26316 "2021-04-06T13:06:07Z")

</div>

Dear all, I would like to build a basic word cloud, but I have issue with overlapping and placing text. I have seen a mention of a wordcloud library “wordcram.org” but it seems obselete. The code below is based on 9…

---

## [How to add new words in a string and display them to create a word-cloud](https://discourse.processing.org/t/how-to-add-new-words-in-a-string-and-display-them-to-create-a-word-cloud/5951)

<div class="topic-metadata">

**Author:** [@polispace](https://discourse.processing.org/u/polispace)\
**Replies:** 4\
**Last updated:** [April 6, 2021, 11:22am UTC](https://discourse.processing.org/t/how-to-add-new-words-in-a-string-and-display-them-to-create-a-word-cloud/5951 "2021-04-06T11:22:18Z")

</div>

Hi everyone. I’m doing an installation for a project, this is my stand point. What do I want to achieve: A program that display a word-cloud (the more a specific word has been say, the bigger it appears in the word cl…

---

## [Is there a "file -\> open" possibility inside of a sketch?](https://discourse.processing.org/t/is-there-a-file-open-possibility-inside-of-a-sketch/29102)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 6\
**Last updated:** [April 5, 2021, 7:06pm UTC](https://discourse.processing.org/t/is-there-a-file-open-possibility-inside-of-a-sketch/29102 "2021-04-05T19:06:52Z")

</div>

I am using the sketch to read various CSV files that have a date in them. Then I interpret the data and make graphs out of it. I use table = loadTable(“Infinity\_Report\_3\_31\_2021.csv”, “header”); Then I populate arra…

---

## [How can I 3d rotate a shape while using size(P2D)?](https://discourse.processing.org/t/how-can-i-3d-rotate-a-shape-while-using-size-p2d/29134)

<div class="topic-metadata">

**Author:** [@JoseMY](https://discourse.processing.org/u/JoseMY)\
**Replies:** 5\
**Last updated:** [April 5, 2021, 6:59pm UTC](https://discourse.processing.org/t/how-can-i-3d-rotate-a-shape-while-using-size-p2d/29134 "2021-04-05T18:59:10Z")

</div>

Hi! I designed a 3D sign using PSHAPE on a P3D environment. The problem is I want to use it in a mixed 2D/3D environment /\* displaying text or 2d graphics on a 3d canvas is a pain. But we can cast a 3d canvas inside…

---

## [Mix 2d and 3d drawings](https://discourse.processing.org/t/mix-2d-and-3d-drawings/29125)

<div class="topic-metadata">

**Author:** [@KelvinLamptey](https://discourse.processing.org/u/KelvinLamptey)\
**Replies:** 1\
**Last updated:** [April 5, 2021, 2:21pm UTC](https://discourse.processing.org/t/mix-2d-and-3d-drawings/29125 "2021-04-05T14:21:12Z")

</div>

Please how do I draw 2d shapes in 3d mode. With processing in Android. With the APDE.

---

## [Scrolling text in different text sizes](https://discourse.processing.org/t/scrolling-text-in-different-text-sizes/28383)

<div class="topic-metadata">

**Author:** [@Ida](https://discourse.processing.org/u/Ida)\
**Replies:** 1\
**Last updated:** [April 5, 2021, 3:19am UTC](https://discourse.processing.org/t/scrolling-text-in-different-text-sizes/28383 "2021-04-05T03:19:05Z")

</div>

Hello, My code writes lines to the screen after the previous one has left it. Is there a possibility to write the lines directly unter the other and not wait until one has left the screen, just like on a website? I als…

---

## [I have a club laser, now to... ...](https://discourse.processing.org/t/i-have-a-club-laser-now-to/28981)

<div class="topic-metadata">

**Author:** [@TheBuildingShow](https://discourse.processing.org/u/TheBuildingShow)\
**Replies:** 4\
**Last updated:** [April 4, 2021, 4:12pm UTC](https://discourse.processing.org/t/i-have-a-club-laser-now-to/28981 "2021-04-04T16:12:18Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi friends, I recently bought a Kvant laser, it’s amazing. I’m trying to see if there’s any processing code that I can upload to it. Within the…

---

## [Copy objects correctly](https://discourse.processing.org/t/copy-objects-correctly/29110)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 6\
**Last updated:** [April 4, 2021, 10:49am UTC](https://discourse.processing.org/t/copy-objects-correctly/29110 "2021-04-04T10:49:52Z")

</div>

I am currently trying to make a program to play chess. I have the following problem. I want to duplicate my object from my board-class and check and evaluate the position. However when I apply a method to a direct cop…

---

## [SVG Element Explosion](https://discourse.processing.org/t/svg-element-explosion/29083)

<div class="topic-metadata">

**Author:** [@p\_a](https://discourse.processing.org/u/p_a)\
**Replies:** 9\
**Last updated:** [April 3, 2021, 12:54pm UTC](https://discourse.processing.org/t/svg-element-explosion/29083 "2021-04-03T12:54:45Z")

</div>

Hi! Is it possible to: Load an SVG get access to all elements (shapes) of that SVG let them drift apart and back together again? Should look like the whole shape explodes, but build itself back together. If it’s not …

---

## [PacMan moving left and right with chomp, not game](https://discourse.processing.org/t/pacman-moving-left-and-right-with-chomp-not-game/29067)

<div class="topic-metadata">

**Author:** [@Panda](https://discourse.processing.org/u/Panda)\
**Replies:** 7\
**Last updated:** [April 3, 2021, 11:56am UTC](https://discourse.processing.org/t/pacman-moving-left-and-right-with-chomp-not-game/29067 "2021-04-03T11:56:37Z")

</div>

Hello. Coding student here. Trying to understand how to make a Pacman character move across the screen while chomping. Once he hits the edge of the window, turns around and goes back the other way. This is one example o…

---

## [Storing all index permutations with Heap's algorithm](https://discourse.processing.org/t/storing-all-index-permutations-with-heaps-algorithm/22326)

<div class="topic-metadata">

**Author:** [@hsolatges](https://discourse.processing.org/u/hsolatges)\
**Replies:** 6\
**Last updated:** [April 3, 2021, 4:08am UTC](https://discourse.processing.org/t/storing-all-index-permutations-with-heaps-algorithm/22326 "2021-04-03T04:08:51Z")

</div>

Hi, I am new on Processing and I am struggling with Java. I am trying to use Heap’s algorithm to get the list of all the permutations of numbers. I want to store that list so I wan use it as a matrix for animation. I …

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

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