#include "stdio.h"typedefunsignedcharuchar;ucharpack_tile(ucharID,ucharpassable){if(ID<128&&(passable==0||passable==1))return(ID<<1)+passable;elseexit(1);/* There's no real error checking in C, so we're just gonna fail * the program if the values aren't good. */}voidread_tile(ucharpackedID){printf("Tile %d:\n",packedID);printf(" ID: %d\n",packedID>>1);if(packedID&1)printf(" passable\n");elseprintf(" non-passable\n");}intmain(intargc,char*argv[]){uchart1=36;uchart1_p=1;// t1 is tile 1 ID valude t1_p determines whether it should be passable or notuchart2=47;uchart2_p=0;uchart3=127;uchart3_p=1;/* So, we'll just read back the packed data and it should print the exact values * that we declared and initialized. */read_tile(pack_tile(t1,t1_p));read_tile(pack_tile(t2,t2_p));read_tile(pack_tile(t3,t3_p));return0;}