Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
String txt = "Hello, world! ";
boolean dir = true;
void draw(){
background(128);
text(txt, 10, height/2);
if(frameCount%10==0){
if(dir) {
txt = rotate(txt, 1);
} else {
txt = rotate(txt, txt.length()-1);
}
}
}
void mouseReleased(){
dir = !dir;
}
String rotate(String text, int startIdx) {
char[] rotated = new char[text.length()];
for (int i = 0; i < text.length(); i++) {
rotated[i] = text.charAt((i + startIdx) % text.length());
}
return String.valueOf(rotated);
}