
CODE 1
PFont myfont;
void setup(){
size(500,500);
background(200);
noLoop();
myfont = createFont("SentyWen",100);
textFont(myfont);
}
void draw(){
int i = 0;
translate(width/2, height/2);
background(200);
textAlign(CENTER, CENTER);
while(i <= 7){
fill(random(255));
textSize(100);
text("Yann", 0, 0);
rotate(PI/4);
i++;
}
}
CODE 1

Function Analyse
The code creates a pattern by rotating the phrase. The first part of the code declared and introduces the setup of the programme.
PFont myfont;
void setup(){
size(500,500);
background(200);
noLoop();
myfont = createFont("SentyWen",100);
textFont(myfont);
}
The code above declare the size of the screen, the background colour and the type of font that need to be use. The noLoop() function has also been used in this code. The function noLoop() stop the programme from continuously executing the code within draw(). In this case, it means that the code under the voiddraw() section will only work once.
void draw(){
int i = 0;
translate(width/2, height/2);
background(200);
textAlign(CENTER, CENTER);
while(i <= 7){
fill(random(255));
textSize(100);
text("Yann", 0, 0);
rotate(PI/4);
i++;
}
}
The second part of the code declared the location of the phrase and make the text rotate. According to the code above, it can be clearly seen that the phrase has been translated to the center of the screen by using the translate function translate(width/2, height/2); Then, in this quote, the textAlign function is also used and this creates a pattern, the function rotate (PI/4); also let the phrase rotates around the circle. And at last, the colour of the text is decide by using the line, fill(random(255));. This means that the colour of the text is random but in a limit between different tone of grey and black since 255 is the only number that is written. This random colours of text creates layers for the programme. This can be seen in the picture above.
Original Code
PFont myfont;
void setup(){
size(800,800);
background(255,255,255);
myfont=createFont("SentyWen",272);
textFont(myfont,272);
translate(400,400);
for(int i=0;i<6;i=i+1){
fill(0,0,0);
textAlign(CENTER);
pushMatrix();
rotate(PI*i/3);
text("The",0,0);
popMatrix();
}
}
Original Code

Modifications
It is clearly seen that there are slightly difference between the original code and the modified code. Many things has changed:
-
Size of the screen
-
Background colour
-
Text Size
-
Location of the text
-
-
All the things above are the small things that changed in the modified code. To make the code better, I changed the colour of the text from a specific colour to any colour tone between grey and black. This can increased the layer of the pattern and make the code much more aesthetic.
In addition, unlike the original code, the modified code is rotate around a circle to create a pattern while the original code is rotate on its own so that there are no space between the pattern. Although the modified code is quite different from the original code, they are still kind of similar.