8x8を8倍角に変換して遊ぶ(if分版



いろいろ、注意
----

- 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 = 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
      if( (al & 0x80) != 0 ){
          b8 = 0xff;
      }

      //7bit
      if( (al & 0x40) != 0 ){
          b7 = 0xff;
      }

      //6bit
      if( (al & 0x20) != 0 ){
          b6 = 0xff;
      }

      //5bit
      if( (al & 0x10) != 0 ){
          b5 = 0xff;
      }


      //eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee


      //4bit
      if( (al & 0x08) != 0 ){
          b4 = 0xff;
      }

      //3bit
      if( (al & 0x04) != 0 ){
          b3 = 0xff;
      }
      
      //2bit
      if( (al & 0x02) != 0 ){
          b2 = 0xff;
      }

      //1bit
      if( (al & 0x01) != 0 ){
          b1 = 0xff;
      }


      //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





```

```


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


```