Python 3, 224 220 219 215 211 211194 bytes
- Thanks to @TFeld for
15 bytes:if(j%27<1)*j
instead ofif j*(j%27<1)
and simplified print statement. - Thanks to @Leaky Nun for 4 bytes:Inverting 0 and 1, did not require the padding by zeros
7*'0'
- @Leaky nun saved 17 bytes with his awesome golfing skills(Thanks a lot!!!!): awesome use of modular indexing
i,j=0,1i=j=0
for x in bin(intk=int("OC5POO6MZYQNBWY0RP6BKBZCOZL13MIAB6I8YZ5N7LXSZBVKX7GC57AW5631YCJ6XCLC""OHZE5WCKDTW6JYMO1JNROAAJQVAN6F8KEO0SMKJM86XIBMCEH5FXXONZGBAVCN3689DS",36))[2:]
while k:r=x=='0';printj+=1;print(['k%2*'theanswertolifetheuniverseandeverything'[i%39]or' ',end='\n'*(40*'theanswertolifetheuniverseandeverything'j%27<1)[i]][r],end=['','\n'][j%27<1]);i+=r;j+=1;i+=k%2;k//=2
Explanation:
Uses base-36 compression to compress this binary number(new-line excluded)
111111100011111111000000111
111111000011111100000000011
111110000011111000111110001
111100000011111000111110001
111000100011111000111110001
110001100011111111111000011
100011100011111111100001111
000111100011111110000111111
000000000000111100011111111
000000000000111000111111111
111111100011111000111111000
111111100011111000000000000
111111100011111000000000000
We basically have two counters i
and j
. On encountering a 1
we print a space; Else if 0
is encountered we print next letter from the string and increase i
. j
increases for each 0 or 1
. We also print new-lines whenever necessary i.e. when j%27<1
becomes true.