Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String original="qwertyuiopasdfghjklzxcvbnm"; //the two strings to be printed I.
- String encrypted;
- void setup(){
- size(1200,600);
- textSize(40);
- fill(0);
- // text("a",50,50);
- text(int('a'),50,85);
- // text(char(int('a')+1),50,115);
- myprint(original,60);//printing first string, "original" being used as value of variable 's' IV.
- encrypted=encrypt(original); // equates second string to be printed with the new string made out of first one V.
- myprint(encrypted,334); //printing second string at different vertical placement VI.
- }
- void draw(){
- }
- String encrypt(String s){ //defines new string as an altering the one below by copying variable 's' but does not print III.
- String s2="";
- for(int i=0;i<s.length()-1; i=i+1){
- s2=s2+char(int(s.charAt(i)+int(s.charAt(i+1)))/2);}
- return s2;
- }
- void myprint(String s,int y){ //function that prints a string with given vertical placement
- for(int i=0;i<s.length();i=i+1){ //s is a variable defined here II.
- textSize(50);
- text(s.charAt(i),i*50,y+i);}
- }
- void keyPressed(){
- // if(key == ' '){=true;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement