barcode
in
Programming Questions
•
1 year ago
i need to make a barcode, right now i have this code:
void setup() {
size(400, 400);
background(255);
drawBarCode(50, 50, 100, 40);
drawBarCode(50, 150, 200, 40);
drawBarCode(50, 250, 300, 100);
}
void drawBarCode(int barX, int barY, int barWid, int barHei) {
rect(barX, barY, barWid, barHei);
int lineX = barX+barWid;
int lineY = barY+barHei;
for (int x =barX; barX<=barY;barX ++);
if (random (0, 2)>=1);
line(barX, barY, barX, lineY);
}
but as u can see theres only 1 line per rectangle, how can i make it so theres more lines
1