Skip to main content
deleted 2 characters in body
Source Link

Comment Out the Comment

I'm back! Lately I've been working on something, but finally I've finished it and can return to CGCC! I'll be continuing the Fast & Golfiest Series soon, and also try to start working on (given I have the time and energy) WumpusWars. For now, a new question as a gift for everyone!

In LaTeX if you type %a, the a would be commented out. But if you type \%a, the a would still be there because the backwards slash converted the meaning of %. And if you type \\%a, the a would be commented out because the first backwards slash converted the meaning of the second one. So do you know what happens to the a if you type \\\\\\\\\\\%\\\%a? (Answer: The a is not commented out).

This is a code golf challenge so shortest code wins: the input is a string which consists exclusively of \ and %, except that at the end there is always an a%a. Output 1 or True if the a is commented out, and 0 or False otherwise.

Comment Out the Comment

I'm back! Lately I've been working on something, but finally I've finished it and can return to CGCC! I'll be continuing the Fast & Golfiest Series soon, and also try to start working on (given I have the time and energy) WumpusWars. For now, a new question as a gift for everyone!

In LaTeX if you type %a, the a would be commented out. But if you type \%a, the a would still be there because the backwards slash converted the meaning of %. And if you type \\%a, the a would be commented out because the first backwards slash converted the meaning of the second one. So do you know what happens to the a if you type \\\\\\\\\\\%\\\%a? (Answer: The a is not commented out).

This is a code golf challenge so shortest code wins: the input is a string which consists exclusively of \ and %, except that at the end there is always an a. Output 1 or True if the a is commented out, and 0 or False otherwise.

Comment Out the Comment

I'm back! Lately I've been working on something, but finally I've finished it and can return to CGCC! I'll be continuing the Fast & Golfiest Series soon, and also try to start working on (given I have the time and energy) WumpusWars. For now, a new question as a gift for everyone!

In LaTeX if you type %a, the a would be commented out. But if you type \%a, the a would still be there because the backwards slash converted the meaning of %. And if you type \\%a, the a would be commented out because the first backwards slash converted the meaning of the second one. So do you know what happens to the a if you type \\\\\\\\\\\%\\\%a? (Answer: The a is not commented out).

This is a code golf challenge so shortest code wins: the input is a string which consists exclusively of \ and %, except that at the end there is always %a. Output 1 or True if the a is commented out, and 0 or False otherwise.

Source Link

Comment Out the Comment

I'm back! Lately I've been working on something, but finally I've finished it and can return to CGCC! I'll be continuing the Fast & Golfiest Series soon, and also try to start working on (given I have the time and energy) WumpusWars. For now, a new question as a gift for everyone!

In LaTeX if you type %a, the a would be commented out. But if you type \%a, the a would still be there because the backwards slash converted the meaning of %. And if you type \\%a, the a would be commented out because the first backwards slash converted the meaning of the second one. So do you know what happens to the a if you type \\\\\\\\\\\%\\\%a? (Answer: The a is not commented out).

This is a code golf challenge so shortest code wins: the input is a string which consists exclusively of \ and %, except that at the end there is always an a. Output 1 or True if the a is commented out, and 0 or False otherwise.