#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
char stev = " ";
String symb = ">";
String symb2 = "<";
int del = 100;

byte topLeftRight[8] = {
  0b00000,
  0b00000,
  0b00000,
  0b11100,
  0b11110,
  0b01111,
  0b00111,
  0b00011
};

byte bottomLeftRight[8] = {
  0b00011,
  0b00111,
  0b01111,
  0b11110,
  0b11100,
  0b00000,
  0b00000,
  0b00000
};

byte topRightRight[8] = {
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b10000,
  0b11000
};

byte bottomRightRight[8] = {
  0b11000,
  0b10000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};

byte topRightLeft[8] = {
  0b00000,
  0b00000,
  0b00000,
  0b00111,
  0b01111,
  0b11110,
  0b11100,
  0b11000
};

byte bottomRightLeft[8] = {
  0b11000,
  0b11100,
  0b11110,
  0b01111,
  0b00111,
  0b00000,
  0b00000,
  0b00000
};

byte topLeftLeft[8] = {
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00001,
  0b00011
};

byte bottomLeftLeft[8] = {
  0b00011,
  0b00001,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};

void setup() {
  lcd.begin(16, 2);
  lcd.createChar(1, topLeftRight);
  lcd.createChar(2, bottomLeftRight);
  lcd.createChar(3, topRightRight);
  lcd.createChar(4, bottomRightRight);
  lcd.createChar(7, topRightLeft);
  lcd.createChar(8, bottomRightLeft);
  lcd.createChar(5, topLeftLeft);
  lcd.createChar(6, bottomLeftLeft);
}

void loop() {
  for (int x = -1; x < 15; x++) {
    if ((x % 2) == 0) {
      lcd.setCursor(x, 1);
      //lcd.print(stev);
      lcd.write(2);
      lcd.write(4);
      //delay(del);
      lcd.setCursor(x, 0);
      //lcd.print(stev);
      lcd.write(1);
      lcd.write(3);
      delay(del);
      lcd.clear();
    }
    else {
      lcd.setCursor(x, 0);
      //lcd.print(stev);
      lcd.write(1);
      lcd.write(3);
      //delay(del);
      lcd.setCursor(x, 1);
      //lcd.print(stev);
      lcd.write(2);
      lcd.write(4);
      delay(del);
      lcd.clear();
    }
  }
  for (int x = 15; x > -1; x--) {
    if ((x % 2) == 0) {
      lcd.setCursor(x, 1);
      lcd.write(6);
      lcd.write(8);
      //lcd.print(stev);

      //delay(del);

      lcd.setCursor(x, 0);
      lcd.write(5);
      lcd.write(7);
      //lcd.print(stev);

      delay(del);
      lcd.clear();
    }
    else {
      lcd.setCursor(x, 0);
      lcd.write(5);
      lcd.write(7);
      //lcd.print(stev);

      //delay(del);

      lcd.setCursor(x, 1);
      lcd.write(6);
      lcd.write(8);
      //lcd.print(stev);
      delay(del);
      lcd.clear();
    }
  }
}