Lol, ok there might be a little more than what meets the eye, cuz when i type `&` (without amp;) it converted it to &
!!
test: &
&
new challenge- try to get it to render a & instead of & inside of `` (or ``` ``` for bulk testing)
tried:
I kinda cheated cuz its not the same character… but I got it to show by using the japanese monospaced & (&)
There’s not enough symbols on my keyboard, so let’s invent a code so we can write other symbols
Now let’s make some real symbols
I want to tell other people how to use our new code, but if I tell them to “just write ÷” it’ll turn my message into “just write ÷” !! So how can we fix this?
What if we make & its own code?
Yes! That’ll work :)
This is how & came to be, and it’s specifically used in HTML as a way to write those symbols above (and escape other a few other symbols for similar reasons we did with &)
As for why & shows up as &, there are 2 main places I can see this happening:
&
as opposed to seeing &
hmm what if you use the escape code to write the escape code :P
&
written as &
… written as &
__LINE__
returns the line of code its on, and% 10
means “remainder 10.” Examples:1 % 10 == 1 ... 8 % 10 == 8 9 % 10 == 9 10 % 10 == 0 <-- loops back to 0 11 % 10 == 1 12 % 10 == 2 ... 19 % 10 == 9 20 % 10 == 0 21 % 10 == 1
In code,
0
meansfalse
and1
(and2
,3
,4
, …) meanstrue
.So, if on line 10, you say:
int dont_delete_database = true;
then it will expand to:
int dont_delete_database = ( 10 % 10 ); // 10 % 10 == 0 which means false // database dies...
if you add a line before it, so that the code moves to line 11, then suddenly it works:
// THIS COMMENT PREVENTS DATABASE FROM DYING int dont_delete_database = ( 11 % 10 ); // 11 % 10 == 1, which means true