SHARE
TWEET

Untitled

advictoriam Jan 15th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ColorCodes
  2. {
  3.    /**
  4.       Returns the code of the given image when doubled in size
  5.       @param img the codes of an image
  6.       @return the color codes of the doubled image
  7.    */
  8.    public String doubleImage(String img)
  9.    {  
  10.       String result = "";
  11.       String buffer = "";
  12.       for (int i = 0; i < img.length(); i++)
  13.       {
  14.           char ch = img.charAt(i);
  15.           if (ch == '\n')
  16.           {
  17.              result += buffer + '\n' + buffer + '\n';
  18.              buffer = "";
  19.           }
  20.           else
  21.           {
  22.              buffer += ch;
  23.              buffer += ch;
  24.           }          
  25.       }
  26.       return result;
  27.    }  
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top