Solve the C++ challenge using the shortest amount of code (what is known as codegolf).
Write a C++ program that generates this text file: totem.txt
My 175 characters solution
which got me 3rd place 🥉
#include <fstream>
int i,j,n=-7;
int main(){
for(std::ofstream f("totem.txt"); ~n; )
for(i=7, f<<7+n++<<"\n"; i-- +6; f<<"\n")
for(j=7; j-- +6; f<<( (i*i+j*j>n*n ? i*j : abs(i)+abs(j)+n) ?'.':'*' ));
}
🍻 Big credit to my very good friend and roommate at that time, Marius, who helped reduce my file size from 188 down to 175. Advancing the solution from 11th place up to 3rd place. And he didn't even want me to split the prize with him at the end. What a good pal 🥲.