Most appropriate sub-area of p5.js?
p5.js version
2.3.0
Web browser and version
Brave 1.90.122
Operating system
Linux Mint 22.1
Steps to reproduce this
Steps:
- Create a 1D vector
- Set v.x to change the "x" value
- Show that setting v.x didn't work
Snippet:
function setup() {
let v = createVector(1);
v.x = 2;
// This should print "vector[2]", but prints "vector[1]"
print(v.toString());
}
Problem
The code contains a comparison if (this.values.length > 1); it doesn't work because the length is 1. The comparison should be if (this.values.length > 0).
Most appropriate sub-area of p5.js?
p5.js version
2.3.0
Web browser and version
Brave 1.90.122
Operating system
Linux Mint 22.1
Steps to reproduce this
Steps:
Snippet:
Problem
The code contains a comparison
if (this.values.length > 1); it doesn't work because the length is 1. The comparison should beif (this.values.length > 0).