Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ColorCodes
- {
- /**
- Returns the code of the given image when doubled in size
- @param img the codes of an image
- @return the color codes of the doubled image
- */
- public String doubleImage(String img)
- {
- String result = "";
- String buffer = "";
- for (int i = 0; i < img.length(); i++)
- {
- char ch = img.charAt(i);
- if (ch == '\n')
- {
- result += buffer + '\n' + buffer + '\n';
- buffer = "";
- }
- else
- {
- buffer += ch;
- buffer += ch;
- }
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement