Semantic change for consistency among functions

Introduce "Pixol" term to describe the resulting array
from converting an image file
This commit is contained in:
David Todd (c0de) 2018-07-06 02:02:01 -05:00
parent d2b25bdf54
commit f5edd358f7
2 changed files with 40 additions and 32 deletions

View File

@ -1,10 +1,21 @@
/*
* This is a "Library" of sorts, where I have made several (admittedly basic)
* functions based off of the original examples provided. Currently these are aimed at
* displaying what I'll dub "Pixols", the 2D array that contains the pixels and RGB
* values resulting from using the python image converter.
*
* You can flash this directly to your pixel to see a demonstration of each
*
* Note that this does not interact with the MPU
*/
#include <Wire.h> // For I2C communication
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_DotStarMatrix.h>
#include <Adafruit_DotStar.h>
#include <ArduinoJson.h>
#include "image.h"
#include "pixols.h"
#define WIDTH 16 // Display width in pixels
#define HEIGHT 16 // Display height in pixels
@ -13,9 +24,7 @@
#define MAX_X (WIDTH * SCALE - 1)
#define MAX_Y (HEIGHT * SCALE - 1)
uint32_t prevTime = 0;
uint8_t backbuffer = 0,
img[WIDTH * HEIGHT];
uint32_t prevTime = 0;
#define DATAPIN 19
#define CLOCKPIN 18
@ -32,20 +41,20 @@ void setup(void) {
matrix.begin();
matrix.setBrightness(BRIGHTNESS);
scanChangeImage(darkness, sh, 1000, 10);
scanChangePxl(darkness, sh, 1000, 10);
}
/*
* showImage, displays an image to the display with no animation
* showPxl, displays a Pixol to the display with no animation
* args:
* - img[256][3] - Standard Pixo-Style icon
* - pxl[256][3] - Standard Pixol image
* - dlytime - The amount of time (in ms) to keep the image on the display
*/
void showImage(int img[256][3], int dlytime) {
void showPxl(int pxl[256][3], int dlytime) {
matrix.fillScreen(0);
for (int i=0; i<256; i++){
matrix.setPixelColor(i, img[i][0], img[i][1], img[i][2]);
matrix.setPixelColor(i, pxl[i][0], pxl[i][1], pxl[i][2]);
}
matrix.show();
@ -58,17 +67,17 @@ void showImage(int img[256][3], int dlytime) {
// Notification functions
/*
* notifyPopupImg, draws an image that scrolls into view, and back down
* notifyPopupPxl, draws a Pixol that scrolls into view, and back down
* args:
* - img[256][3] - Standard Pixo-Style icon
* - pxl[256][3] - Standard Pixol image
* - dlytime - The amount of time (in ms) to keep the image on the display
*/
void notifyPopupImg(int img[256][3], int dlytime) {
void notifyPopupPxl(int pxl[256][3], int dlytime) {
for (int j = 15; j >= 0; j--) {
matrix.fillScreen(0);
for (int i = 0; i < 256; i++) {
matrix.setPixelColor(i + (j * 16),
img[i][0], img[i][1], img[i][2]);
pxl[i][0], pxl[i][1], pxl[i][2]);
}
matrix.show();
delay(50);
@ -80,31 +89,29 @@ void notifyPopupImg(int img[256][3], int dlytime) {
matrix.fillScreen(0);
for (int i = 0; i < 256; i++) {
matrix.setPixelColor(i + (j * 16),
img[i][0], img[i][1], img[i][2]);
pxl[i][0], pxl[i][1], pxl[i][2]);
}
matrix.show();
delay(50);
}
delay(100);
matrix.fillScreen(0);
matrix.show();
}
/*
* notifyScrollImg, draws an image that scrolls upward into view, and upwards out; Loop this to scroll continuously
* notifyScrollPxl, draws a Pixol that scrolls upward into view, and upwards out; Loop this to scroll X times
* args:
* - img[256][3] - Standard Pixo-Style icon
* - pxl[256][3] - Standard Pixol image
* - dlytime - The amount of time (in ms) to keep the image on the display
* - loops (optional) - The total amount of times this should loop through
*/
void notifyScrollImg(int img[256][3], int dlytime, int loops=0) {
void notifyScrollPxl(int pxl[256][3], int dlytime, int loops=0) {
for (int x=0; x<=loops; x++) {
for (int j = 15; j >= 0; j--) {
matrix.fillScreen(0);
for (int i = 0; i < 256; i++) {
matrix.setPixelColor(i + (j * 16),
img[i][0], img[i][1], img[i][2]);
pxl[i][0], pxl[i][1], pxl[i][2]);
}
matrix.show();
delay(15);
@ -116,29 +123,27 @@ void notifyScrollImg(int img[256][3], int dlytime, int loops=0) {
matrix.fillScreen(0);
for (int i = 0; i < 256; i++) {
matrix.setPixelColor(i + (j * 16),
img[i][0], img[i][1], img[i][2]);
pxl[i][0], pxl[i][1], pxl[i][2]);
}
matrix.show();
delay(15);
}
delay(100);
matrix.fillScreen(0);
matrix.show();
}
}
// "Animation" or picture transition functions
/*
* scanChangeImage, Change from one image to another with a scanline appearence
* scanChangePxl, Change from one Pixol to another with a scanline appearence
* args:
* - src[256][3] - Standard Pixo-Style icon that we change from, displayed all at once
* - dst[256][3] - Standard Pixo-Style icon that we change to, displayed one pixel at a time
* - dlytime - The amount of time (in ms) to keep the image on the display
* - anitime - The amount of time (in ms) between drawing each pixel during the transition; the lower this number, the faster the transition
*/
void scanChangeImage(int src[256][3], int dst[256][3], int dlytime, int anitime) {
void scanChangePxl(int src[256][3], int dst[256][3], int dlytime, int anitime) {
for (int i=0; i<256; i++){
matrix.setPixelColor(i, src[i][0], src[i][1], src[i][2]);
}
@ -156,14 +161,14 @@ void scanChangeImage(int src[256][3], int dst[256][3], int dlytime, int anitime)
}
/*
* randChangeImage, Change from one image to another with a random pixel selection
* randChangePxl, Change from one Pixol to another with a random pixel selection
* args:
* - src[256][3] - Standard Pixo-Style icon that we change from, displayed all at once
* - dst[256][3] - Standard Pixo-Style icon that we change to, displayed one pixel at a time
* - dlytime - The amount of time (in ms) to keep the image on the display
* - anitime - The amount of time (in ms) between drawing each pixel during the transition; the lower this number, the faster the transition
*/
void randChangeImage(int src[256][3], int dst[256][3], int dlytime, int anitime) {
void randChangePxl(int src[256][3], int dst[256][3], int dlytime, int anitime) {
int changed[256];
for (int i=0; i<256; i++){
matrix.setPixelColor(i, src[i][0], src[i][1], src[i][2]);
@ -190,9 +195,12 @@ void loop() {
while (((t = micros()) - prevTime) < (1000000L / MAX_FPS)); // FPS Limit?
prevTime = t;
showImage(twitter, 1000);
notifyPopupImg(glogo, 500);
notifyScrollImg(upvote, 1000, 4);
showPxl(twitter, 1000);
notifyPopupPxl(glogo, 500);
notifyScrollPxl(upvote, 1000, 4);
notifyScrollPxl(mario, 1000); // Not specifying the loop will make it only show once
randChangeImage(mario, pridec0de, 1000, 10);
// This is supposed to be a random pixel fill transition, but
// the rng does not guarentee unique numbers in the range automatically
randChangePxl(mario, pridec0de, 1000, 10);
}

View File

@ -8,4 +8,4 @@ int twitter[256][3] = {{40, 170, 225}, {40, 170, 225}, {40, 170, 225}, {40, 170,
int ig[256][3] = {{0, 0, 0}, {182, 45, 118}, {190, 52, 133}, {177, 58, 155}, {176, 70, 183}, {166, 79, 206}, {159, 82, 215}, {155, 79, 212}, {151, 76, 208}, {148, 73, 203}, {144, 70, 199}, {140, 67, 194}, {128, 59, 178}, {125, 57, 176}, {118, 54, 163}, {0, 0, 0}, {209, 27, 81}, {204, 35, 93}, {217, 48, 127}, {184, 51, 134}, {169, 59, 155}, {158, 68, 177}, {148, 77, 200}, {143, 76, 200}, {141, 72, 193}, {138, 69, 189}, {133, 66, 184}, {129, 62, 180}, {129, 61, 179}, {142, 66, 199}, {121, 56, 171}, {118, 54, 163}, {221, 21, 56}, {241, 31, 82}, {206, 36, 94}, {184, 49, 120}, {197, 50, 125}, {184, 55, 144}, {169, 61, 161}, {155, 72, 185}, {147, 77, 201}, {144, 75, 195}, {143, 71, 196}, {142, 71, 198}, {131, 65, 172}, {129, 61, 178}, {142, 66, 198}, {121, 56, 170}, {236, 13, 35}, {232, 21, 56}, {213, 24, 65}, {202, 35, 92}, {215, 48, 127}, {197, 56, 146}, {184, 64, 167}, {176, 72, 190}, {165, 81, 211}, {155, 81, 214}, {153, 78, 210}, {145, 73, 199}, {137, 68, 189}, {127, 63, 178}, {129, 62, 181}, {128, 60, 179}, {255, 6, 18}, {235, 10, 28}, {213, 26, 67}, {239, 31, 81}, {203, 35, 93}, {194, 42, 112}, {196, 53, 138}, {175, 57, 151}, {163, 66, 171}, {162, 78, 202}, {148, 77, 202}, {133, 69, 185}, {138, 69, 190}, {137, 68, 188}, {128, 63, 179}, {141, 67, 195}, {255, 8, 3}, {246, 3, 8}, {226, 18, 46}, {245, 21, 56}, {216, 28, 75}, {210, 36, 95}, {192, 46, 118}, {171, 53, 137}, {171, 62, 161}, {157, 71, 180}, {155, 76, 198}, {148, 77, 204}, {150, 76, 205}, {139, 71, 192}, {136, 65, 184}, {143, 70, 198}, {255, 33, 1}, {246, 15, 1}, {241, 8, 24}, {253, 13, 34}, {234, 22, 59}, {216, 28, 71}, {199, 34, 89}, {205, 43, 113}, {190, 53, 138}, {176, 54, 142}, {151, 72, 176}, {155, 75, 196}, {159, 83, 219}, {143, 72, 196}, {137, 68, 186}, {147, 73, 202}, {255, 64, 1}, {246, 47, 3}, {246, 0, 2}, {255, 6, 15}, {235, 13, 35}, {216, 23, 54}, {216, 29, 75}, {217, 38, 100}, {197, 44, 116}, {206, 60, 155}, {179, 55, 137}, {158, 68, 175}, {177, 85, 222}, {145, 77, 202}, {141, 72, 191}, {151, 76, 207}, {255, 94, 1}, {246, 75, 3}, {244, 19, 2}, {255, 12, 2}, {245, 1, 9}, {227, 20, 48}, {242, 21, 56}, {212, 27, 74}, {205, 35, 91}, {211, 48, 126}, {186, 48, 126}, {170, 62, 162}, {191, 77, 202}, {153, 73, 189}, {144, 74, 199}, {155, 79, 211}, {255, 125, 1}, {248, 103, 3}, {244, 51, 2}, {255, 40, 0}, {246, 7, 1}, {231, 7, 23}, {237, 13, 33}, {242, 21, 56}, {222, 28, 74}, {231, 40, 105}, {196, 40, 105}, {178, 53, 137}, {201, 67, 177}, {165, 63, 165}, {146, 77, 202}, {158, 82, 215}, {255, 156, 1}, {246, 131, 3}, {244, 78, 2}, {255, 71, 0}, {255, 32, 1}, {245, 14, 0}, {231, 9, 32}, {244, 14, 37}, {232, 22, 60}, {208, 29, 77}, {195, 37, 97}, {199, 43, 114}, {197, 56, 147}, {176, 56, 146}, {155, 72, 182}, {165, 79, 205}, {255, 187, 1}, {246, 155, 1}, {245, 102, 6}, {255, 105, 0}, {246, 59, 0}, {250, 32, 1}, {247, 11, 0}, {235, 0, 4}, {233, 15, 31}, {227, 18, 48}, {219, 29, 76}, {207, 35, 94}, {211, 48, 127}, {187, 48, 124}, {166, 62, 163}, {179, 71, 185}, {249, 201, 1}, {249, 182, 1}, {234, 142, 20}, {247, 117, 1}, {255, 107, 0}, {255, 70, 0}, {255, 40, 0}, {255, 11, 2}, {255, 6, 15}, {255, 15, 40}, {247, 21, 57}, {236, 30, 78}, {212, 37, 97}, {187, 42, 110}, {181, 52, 136}, {180, 59, 154}, {245, 212, 4}, {255, 225, 0}, {247, 183, 3}, {236, 132, 18}, {252, 115, 4}, {249, 84, 1}, {244, 54, 1}, {246, 24, 0}, {246, 0, 1}, {242, 5, 19}, {234, 15, 41}, {229, 25, 68}, {202, 32, 78}, {203, 35, 94}, {219, 49, 129}, {183, 50, 129}, {245, 218, 18}, {247, 214, 2}, {255, 224, 0}, {247, 181, 1}, {244, 159, 2}, {247, 135, 5}, {244, 107, 2}, {246, 79, 2}, {244, 49, 2}, {246, 16, 0}, {246, 2, 5}, {235, 9, 24}, {227, 19, 52}, {243, 32, 83}, {206, 36, 95}, {196, 39, 107}, {0, 0, 0}, {245, 217, 18}, {250, 217, 4}, {249, 201, 1}, {255, 188, 2}, {255, 155, 1}, {255, 124, 1}, {255, 94, 1}, {255, 64, 1}, {255, 33, 1}, {255, 8, 3}, {255, 7, 19}, {238, 14, 38}, {228, 21, 57}, {205, 29, 58}, {0, 0, 0}};
int upvote[256][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {31, 8, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {255, 68, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
int glogo[256][3] = {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {11, 11, 11}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {125, 125, 125}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {116, 116, 116}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {170, 170, 170}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}};
//int mario[256][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}};
int mario[256][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}};