CodingTrain / CodingTrain/Suggestion-Box

Mondrian

Open
#456 1 comment 0 reactions 0 assignees View on GitHub
Help wanted
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

`Hey` Daniel , I was thinking about a code that could generate a neoplastic artwork(specifically from piet mondrian), I made a quick sketch on processing:

```

Mondrian a;
void setup(){
background(255);
size(600,440);
a = new Mondrian();}
void draw(){
noLoop();

a.display();
}
class Mondrian{

void display(){

for (float i=0;i<40;i=i+1){
float larg=random(width);
float altura=random(height);
float x=random(width);
float y=random(height);
color red=color(255,0,0);
color yellow=color(255,255,0);
color b=color(0,0,255);
color branco=color(255,255,255);
color[] cores={red,yellow,b,branco};
int index=int(random(4));
fill(cores[index]);

rect(x,y,larg,altura);


strokeWeight(4);
println(i);}}}
```

An issue that I couldn't fix yet is that I couldnt make the rectangles stop overlapping each others, and I dont know how to use p5 yet.... :( I started learning code 6 days ago, so I am still a padwan.... I love your videos!Thank you and sorry for this bad code here!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.