8x8を8倍角に変換して遊ぶ(ビット操作のみ版


いろいろ、注意
----

- arduinoでの予定は、未定


プログラム
----

オンラインコンパイラ　paiza

```c++


#include <iostream>
using namespace std;

#define b_put(aa) for(int ii=8;ii!=0;ii--){if(aa & 0x80){printf("#");}else{printf(".");}aa=aa<<1;}
#define bit8_put(bb) for(int jj=0;jj<64;jj++){b_put(bb[jj*8]);b_put(bb[jj*8+1]);b_put(bb[jj*8+2]);b_put(bb[jj*8+3]);b_put(bb[jj*8+4]);b_put(bb[jj*8+5]);b_put(bb[jj*8+6]);b_put(bb[jj*8+7]);printf("\n");}

int main(void){
    // Your code here!

    unsigned char font[] = {
        0b00100000, //  #     
        0b01111100, // #####  
        0b00100000, //  #     
        0b01111100, // #####  
        0b10101010, //# # # # 
        0b10110010, //# ##  # 
        0b01100100, // ##  #  
        0b00000000  //
    };  
    
    unsigned char font2[8*64];


    int j = 0; //8倍角出力フォントのカウンター
    for (int i = 0; i < 8; i++) { //フォントの8倍角化ループ

      int al;
      int bk = font[i]; //入力フォントの読み出し
      int b1=0;int b2=0;int b3=0;int b4=0;
      int b5=0;int b6=0;int b7=0;int b8=0;


      //8bit
      al = bk;
      al = al >> 7;
      al = 1 - al;
      b8 = 0xff + al;
      

      //7bit
      al = bk;
      al = al >> 6;
      al = al & 0x01;
      al = 1 - al;
      b7 = 0xff + al;

      //6bit
      al = bk;
      al = al >> 5;
      al = al & 0x01;
      al = 1 - al;
      b6 = 0xff + al;

      //5bit
      al = bk;
      al = al >> 4;
      al = al & 0x01;
      al = 1 - al;
      b5 = 0xff + al;


      //eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee


      //4bit
      al = bk;
      al = al >> 3;
      al = al & 0x01;
      al = 1 - al;
      b4 = 0xff + al;

      //3bit
      al = bk;
      al = al >> 2;
      al = al & 0x01;
      al = 1 - al;
      b3 = 0xff + al;
      
      //2bit
      al = bk;
      al = al >> 1;
      al = al & 0x01;
      al = 1 - al;
      b2 = 0xff + al;

      //1bit
      al = bk;
      al = al & 0x01;
      al = 1 - al;
      b1 = 0xff + al;


      //1
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //2
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //3
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //4
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //5
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //6
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //7
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;

      //8
      font2[j++] = b8;
      font2[j++] = b7;
      font2[j++] = b6;
      font2[j++] = b5;

      font2[j++] = b4;
      font2[j++] = b3;
      font2[j++] = b2;
      font2[j++] = b1;


    }  //for

     bit8_put(font2);

    
} //main


```


```

................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
................########........................................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
........########################################................
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........########........########........########........
########........################................########........
########........################................########........
########........################................########........
########........################................########........
########........################................########........
########........################................########........
########........################................########........
########........################................########........
........################................########................
........################................########................
........################................########................
........################................########................
........################................########................
........################................########................
........################................########................
........################................########................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................


```