# Coding Questions

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

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

**Page:** 171

---

## [Play field boundary for a: rect for loop](https://discourse.processing.org/t/play-field-boundary-for-a-rect-for-loop/4487)

<div class="topic-metadata">

**Author:** [@SolDrakibane](https://discourse.processing.org/u/SolDrakibane)\
**Replies:** 5\
**Last updated:** [October 17, 2018, 8:39pm UTC](https://discourse.processing.org/t/play-field-boundary-for-a-rect-for-loop/4487 "2018-10-17T20:39:12Z")

</div>

Alright, so for my assignment i need to make a Memory Card game. However, one of the first things i need to wrap my head around is the boundary. I need to be able to loop the cards inside the playField. I also need to m…

---

## [Help for a code](https://discourse.processing.org/t/help-for-a-code/4561)

<div class="topic-metadata">

**Author:** [@singenya](https://discourse.processing.org/u/singenya)\
**Replies:** 1\
**Last updated:** [October 17, 2018, 5:23pm UTC](https://discourse.processing.org/t/help-for-a-code/4561 "2018-10-17T17:23:10Z")

</div>

hello I need help on a code, I’m trying to make a line that would move from the top to bottom and when it reach the bottom it get back to the top. I’ve done this and achieved making it get down but I can’t manage to ma…

---

## [Rectangle should grow then stop (resolved)](https://discourse.processing.org/t/rectangle-should-grow-then-stop-resolved/4541)

<div class="topic-metadata">

**Author:** [@singenya](https://discourse.processing.org/u/singenya)\
**Replies:** 2\
**Last updated:** [October 16, 2018, 5:30pm UTC](https://discourse.processing.org/t/rectangle-should-grow-then-stop-resolved/4541 "2018-10-16T17:30:01Z")

</div>

hello, i’m a beginner on processing and I want to make something simple but I don’t really understand why it don’t work. here’s my code : void setup() { size(600, 600); background(255); } void draw() { for (int …

---

## [Getting unexpected return value when appending to array](https://discourse.processing.org/t/getting-unexpected-return-value-when-appending-to-array/4498)

<div class="topic-metadata">

**Author:** [@LethalShadow](https://discourse.processing.org/u/LethalShadow)\
**Replies:** 5\
**Last updated:** [October 16, 2018, 3:36pm UTC](https://discourse.processing.org/t/getting-unexpected-return-value-when-appending-to-array/4498 "2018-10-16T15:36:53Z")

</div>

Hello programmers, I am trying to write a program for a school excercise and it’s actually coming along quite nicely. It’s supposed to be a game called subset (a lighter version of a game called “set”). The game consi…

---

## [Help! Clocks! - Minutes & For Loops](https://discourse.processing.org/t/help-clocks-minutes-for-loops/4527)

<div class="topic-metadata">

**Author:** [@madiMcD](https://discourse.processing.org/u/madiMcD)\
**Replies:** 3\
**Last updated:** [October 16, 2018, 1:26pm UTC](https://discourse.processing.org/t/help-clocks-minutes-for-loops/4527 "2018-10-16T13:26:39Z")

</div>

Hello! I’m in the process currently of trying to make a program that runs a type of clock. I am using images in my program, but for the purposes of my question, I have substituted ellipses. I understand how to use a nes…

---

## [Nf() issue with decimal point](https://discourse.processing.org/t/nf-issue-with-decimal-point/4125)

<div class="topic-metadata">

**Author:** [@gyula](https://discourse.processing.org/u/gyula)\
**Replies:** 20\
**Last updated:** [October 16, 2018, 7:46am UTC](https://discourse.processing.org/t/nf-issue-with-decimal-point/4125 "2018-10-16T07:46:59Z")

</div>

Hi, The following prints 1,2 (with comma) instead of 1.2: float f = 1.23; String s = nf(f, 0, 1); println(s); // Prints "1,2" That behaviour was already reported in April 2016, yet contiues to contradict the descript…

---

## [請教各位大大教導如何寫顏色變數](https://discourse.processing.org/t/topic/4519)

<div class="topic-metadata">

**Author:** [@alk5603](https://discourse.processing.org/u/alk5603)\
**Replies:** 4\
**Last updated:** [October 16, 2018, 7:14am UTC](https://discourse.processing.org/t/topic/4519 "2018-10-16T07:14:46Z")

</div>

各位大大好 小弟想請教一下,關於球類的問題 只要球有連一條線就變色 二條線又變另一種顏色 三條線又變一種色 那我的代碼要怎麼打比較好 請各位大大指教 1.一條線變藍 2.二條線變紅 3.三條線變黃 int num = 50, radius = 50; int\[\] posX, posY, speedX, speedY; void setup() { size(800, 600); stroke(255); …

---

## [Opengl shader error](https://discourse.processing.org/t/opengl-shader-error/4493)

<div class="topic-metadata">

**Author:** [@aaditya99983](https://discourse.processing.org/u/aaditya99983)\
**Replies:** 0\
**Last updated:** [October 15, 2018, 3:25pm UTC](https://discourse.processing.org/t/opengl-shader-error/4493 "2018-10-15T15:25:12Z")

</div>

I am getting this error while trying some saved examples from processing ide : Cannot compile vertex shader: 0:1(10): error: GLSL 0.00 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES can someone help …

---

## [Sketch does not run; P2D Error (\[...\] Please call TIS/TSM in main thread) - Looking for workaround](https://discourse.processing.org/t/sketch-does-not-run-p2d-error-please-call-tis-tsm-in-main-thread-looking-for-workaround/4488)

<div class="topic-metadata">

**Author:** [@polispace](https://discourse.processing.org/u/polispace)\
**Replies:** 2\
**Last updated:** [October 15, 2018, 1:06pm UTC](https://discourse.processing.org/t/sketch-does-not-run-p2d-error-please-call-tis-tsm-in-main-thread-looking-for-workaround/4488 "2018-10-15T13:06:35Z")

</div>

Hi there I’ve already seen questions about this topic and I’m aware there is still not a real solution for this error. I couldn’t find a workaround to allow my sketch to run. Wondering if form the community here I can g…

---

## [Changing Images on Click?](https://discourse.processing.org/t/changing-images-on-click/4479)

<div class="topic-metadata">

**Author:** [@emmytime](https://discourse.processing.org/u/emmytime)\
**Replies:** 4\
**Last updated:** [October 15, 2018, 7:48am UTC](https://discourse.processing.org/t/changing-images-on-click/4479 "2018-10-15T07:48:34Z")

</div>

Hey gang, My names Emmy and i’ve been tasked to do a data visualisation on processing as one of my uni classes, and am portraying the different items accessible from the Mario 64 prize boxes. I am envisioning to click o…

---

## [Nedd help with a class](https://discourse.processing.org/t/nedd-help-with-a-class/4409)

<div class="topic-metadata">

**Author:** [@EricSaumier](https://discourse.processing.org/u/EricSaumier)\
**Replies:** 4\
**Last updated:** [October 15, 2018, 1:23am UTC](https://discourse.processing.org/t/nedd-help-with-a-class/4409 "2018-10-15T01:23:55Z")

</div>

Hello! I’m getting back into coding after 20 some years.. I’ve been toying around with processing for a year now, doing simple things.. but this time, I want to learn classes I have followed this tutorial Objects by…

---

## [Extending the mouse range past the screen size](https://discourse.processing.org/t/extending-the-mouse-range-past-the-screen-size/4431)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 12\
**Last updated:** [October 14, 2018, 4:15pm UTC](https://discourse.processing.org/t/extending-the-mouse-range-past-the-screen-size/4431 "2018-10-14T16:15:22Z")

</div>

You see this in a lot of games, this kind of infinite mouse movement, where you can move your mouse around as much as you want, without ever getting stopped by the edges of your screen. I’ve made something like this, an…

---

## [Hovering over an image and changing colour](https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319)

<div class="topic-metadata">

**Author:** [@livgrisss](https://discourse.processing.org/u/livgrisss)\
**Replies:** 1\
**Last updated:** [October 14, 2018, 5:37am UTC](https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319 "2018-10-14T05:37:01Z")

</div>

Hey so I’m trying to make a code that basically is made up of all the states in australia, so when i hover over the (image) i’ve input into the code (one image for each state) they will change colour. what is the easest…

---

## [Saving pdf for Arabic text](https://discourse.processing.org/t/saving-pdf-for-arabic-text/4288)

<div class="topic-metadata">

**Author:** [@AYS](https://discourse.processing.org/u/AYS)\
**Replies:** 1\
**Last updated:** [October 14, 2018, 5:30am UTC](https://discourse.processing.org/t/saving-pdf-for-arabic-text/4288 "2018-10-14T05:30:16Z")

</div>

Hello There, I have this problem where Arabic text will show correctly when I run my sketch but when I save as pdf, the Arabic text is then flipped. I’m not sure what the issue is. I could save png but I need the text …

---

## [How do i draw an angular space with a quad?](https://discourse.processing.org/t/how-do-i-draw-an-angular-space-with-a-quad/4378)

<div class="topic-metadata">

**Author:** [@Noman](https://discourse.processing.org/u/Noman)\
**Replies:** 8\
**Last updated:** [October 14, 2018, 4:29am UTC](https://discourse.processing.org/t/how-do-i-draw-an-angular-space-with-a-quad/4378 "2018-10-14T04:29:04Z")

</div>

I am trying to draw an angular space with using the quad command and trigonometry but cant figure it out. please need some urgent help

---

## [Tracking ball task with smooth curve](https://discourse.processing.org/t/tracking-ball-task-with-smooth-curve/4245)

<div class="topic-metadata">

**Author:** [@Fishe](https://discourse.processing.org/u/Fishe)\
**Replies:** 4\
**Last updated:** [October 14, 2018, 4:24am UTC](https://discourse.processing.org/t/tracking-ball-task-with-smooth-curve/4245 "2018-10-14T04:24:22Z")

</div>

Hi there, I have a very simply tracking task in which people track a ball with their mouse. Currently the ball bounces off the edges of the screen, however I would like it to follow along a smooth curve (basically so th…

---

## [Random selection from a list of weighted probabilities](https://discourse.processing.org/t/random-selection-from-a-list-of-weighted-probabilities/4262)

<div class="topic-metadata">

**Author:** [@grumo](https://discourse.processing.org/u/grumo)\
**Replies:** 3\
**Last updated:** [October 14, 2018, 12:48am UTC](https://discourse.processing.org/t/random-selection-from-a-list-of-weighted-probabilities/4262 "2018-10-14T00:48:27Z")

</div>

I’m doing a simulator that produces a color given a probability found in a collection of colors and its occurrences. I have a CVS with 1120 rows with different colors and shades. Every color have a number (the number of…

---

## [Reading HTML from a twitch page](https://discourse.processing.org/t/reading-html-from-a-twitch-page/4444)

<div class="topic-metadata">

**Author:** [@metype](https://discourse.processing.org/u/metype)\
**Replies:** 1\
**Last updated:** [October 14, 2018, 12:22am UTC](https://discourse.processing.org/t/reading-html-from-a-twitch-page/4444 "2018-10-14T00:22:33Z")

</div>

Ok so I am trying to grab the HTML from a twitch page and am having issues as I am getting something completely different from what I;d normally see in the console. String\[\] html; void setup() { size(400,400); html…

---

## [Int can't be a value?](https://discourse.processing.org/t/int-cant-be-a-value/4159)

<div class="topic-metadata">

**Author:** [@Lore](https://discourse.processing.org/u/Lore)\
**Replies:** 9\
**Last updated:** [October 13, 2018, 9:20pm UTC](https://discourse.processing.org/t/int-cant-be-a-value/4159 "2018-10-13T21:20:39Z")

</div>

Is there a way to make a statement where you declare that an int value cannot be a certain number? For example, if you say int test = 5; would there be a way to say test ≠ 20

---

## [Creating animations from tabulated string data](https://discourse.processing.org/t/creating-animations-from-tabulated-string-data/4117)

<div class="topic-metadata">

**Author:** [@Nicole\_C\_973](https://discourse.processing.org/u/Nicole_C_973)\
**Replies:** 3\
**Last updated:** [October 13, 2018, 9:12pm UTC](https://discourse.processing.org/t/creating-animations-from-tabulated-string-data/4117 "2018-10-13T21:12:31Z")

</div>

Hi guys I’m very new to processing and am creating a data visualisation from some excel spreadsheet data. The data is made up of strings (not numbers) and is pasted below. I need to know how to write a code that says: …

---

## [Camera clip problem](https://discourse.processing.org/t/camera-clip-problem/4110)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 3\
**Last updated:** [October 13, 2018, 9:05pm UTC](https://discourse.processing.org/t/camera-clip-problem/4110 "2018-10-13T21:05:52Z")

</div>

hello! this is my camera class, i\`ve a problem when rotating at rx axes, it seems that clipping problem at 180 degrees in that axes. i want to be free to rotating full 360ª . what im doing wrong? class Player { PVecto…

---

## [Unexpected token:void](https://discourse.processing.org/t/unexpected-token-void/4430)

<div class="topic-metadata">

**Author:** [@sissib](https://discourse.processing.org/u/sissib)\
**Replies:** 1\
**Last updated:** [October 13, 2018, 7:51pm UTC](https://discourse.processing.org/t/unexpected-token-void/4430 "2018-10-13T19:51:54Z")

</div>

here is my code: float xcoord; float ycoord; float npoints; float xdivider; float ydivider; void setup () { size (600,600); npoints=12; xdivider=width/(npoints+1); ydivider=height/(npoints+1); …

---

## [Time based pattern](https://discourse.processing.org/t/time-based-pattern/4399)

<div class="topic-metadata">

**Author:** [@ehasti21](https://discourse.processing.org/u/ehasti21)\
**Replies:** 4\
**Last updated:** [October 13, 2018, 12:12am UTC](https://discourse.processing.org/t/time-based-pattern/4399 "2018-10-13T00:12:19Z")

</div>

I’m still awaiting a bright soul to help me understand this aspect of coding\*Hello all, we are currently working on a time-based pattern project for class but i’ve manage to hit a wall working on my code. I am new to wor…

---

## [Show image in setup](https://discourse.processing.org/t/show-image-in-setup/4347)

<div class="topic-metadata">

**Author:** [@FerrariLuigi](https://discourse.processing.org/u/FerrariLuigi)\
**Replies:** 3\
**Last updated:** [October 12, 2018, 5:35pm UTC](https://discourse.processing.org/t/show-image-in-setup/4347 "2018-10-12T17:35:27Z")

</div>

Dear all, I wrote a processing sketch that has a very long setup function. During setup I have to read many files and I have to initialize a large number of varabiles. Unfortunately during setup the screen is complitel…

---

## [Amorphous/Round Shapes around Polygons/Triangles](https://discourse.processing.org/t/amorphous-round-shapes-around-polygons-triangles/4072)

<div class="topic-metadata">

**Author:** [@anneklappe](https://discourse.processing.org/u/anneklappe)\
**Replies:** 5\
**Last updated:** [October 12, 2018, 2:54pm UTC](https://discourse.processing.org/t/amorphous-round-shapes-around-polygons-triangles/4072 "2018-10-12T14:54:46Z")

</div>

Hello, Multiple particles are flying around in my sketch. When the points are close enough to each other, lines are drawn in between. When three points are close to each other, the lines shape a triangle between the poi…

---

## [How to get array.length after calculating greater(less) than?](https://discourse.processing.org/t/how-to-get-array-length-after-calculating-greater-less-than/4336)

<div class="topic-metadata">

**Author:** [@SolDrakibane](https://discourse.processing.org/u/SolDrakibane)\
**Replies:** 2\
**Last updated:** [October 11, 2018, 11:25am UTC](https://discourse.processing.org/t/how-to-get-array-length-after-calculating-greater-less-than/4336 "2018-10-11T11:25:51Z")

</div>

Alright, so i have numbers that i need to calculate in this code. And i need to calculate all the array numbers above 5.5 and set them into a .length so i can calculate the amount of sufficient scores. I also need to do …

---

## [Create Blinking Eyes](https://discourse.processing.org/t/create-blinking-eyes/4343)

<div class="topic-metadata">

**Author:** [@Mick](https://discourse.processing.org/u/Mick)\
**Replies:** 3\
**Last updated:** [October 11, 2018, 7:11am UTC](https://discourse.processing.org/t/create-blinking-eyes/4343 "2018-10-11T07:11:15Z")

</div>

Hello fellow programmers, I need some help with my code. I’m trying to create eyes in processing that can blink. I want to be able to control each individual eyelid (left eye upper and lower lid and right eye upper and …

---

## [Cant open a .json file](https://discourse.processing.org/t/cant-open-a-json-file/4333)

<div class="topic-metadata">

**Author:** [@eilamM](https://discourse.processing.org/u/eilamM)\
**Replies:** 1\
**Last updated:** [October 11, 2018, 6:47am UTC](https://discourse.processing.org/t/cant-open-a-json-file/4333 "2018-10-11T06:47:08Z")

</div>

Hi, so every time I try to open a .json file via Processing, it crashes, and telling me “I don’t know how to a sketch with the “json” file extension.”. I have both Java and p5.js Modes installed. I’m kinda new to the …

---

## [Moving objects assignment](https://discourse.processing.org/t/moving-objects-assignment/4346)

<div class="topic-metadata">

**Author:** [@guru\_tk](https://discourse.processing.org/u/guru_tk)\
**Replies:** 6\
**Last updated:** [October 11, 2018, 4:19am UTC](https://discourse.processing.org/t/moving-objects-assignment/4346 "2018-10-11T04:19:48Z")

</div>

this is the question https://photos.google.com/photo/AF1QipM2ICRz3oqmgr-gBQ7dQp5yBVqK1\_ag2hX2v0ap https://photos.google.com/photo/AF1QipOUSXFSEl3n3UNftSNsEon3xtcczVtXGArcZV6G Create a new program, with a size of 400…

---

## [Tabulated Data won't load (null pointer exception error)](https://discourse.processing.org/t/tabulated-data-wont-load-null-pointer-exception-error/4315)

<div class="topic-metadata">

**Author:** [@Nicole\_C\_973](https://discourse.processing.org/u/Nicole_C_973)\
**Replies:** 6\
**Last updated:** [October 11, 2018, 1:30am UTC](https://discourse.processing.org/t/tabulated-data-wont-load-null-pointer-exception-error/4315 "2018-10-11T01:30:36Z")

</div>

Hi guys I’ve managed to create an animation that works (reading strings from tabulated data)! Woo hoo. Except… I’ve made a few small changes to my tabular data, have re-saved it as a tsv file again (same name as before…

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

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