lgbasallote
  • lgbasallote
How does the ``` work? Does it just color the font if the code is right?
OpenStudy Feedback
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
lgbasallote
  • lgbasallote
``` i'm talking about this ```
farmdawgnation
  • farmdawgnation
The code block tries to guess the language. I tried to implement it such that you could force it into a particular language by typing the language name on the same line after the backticks... \`\`\`python ^ Like that. But, it's not working at the moment. So, really, it looks at the code your provide and guesses. It's usually pretty accurate.
lgbasallote
  • lgbasallote
i mean the colors...what do they mean?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

farmdawgnation
  • farmdawgnation
It's syntax highlighting, so if something is a color other than black it's usually a reserved word or special construct in whatever language you're working in. So, for HTML.. ``` OpenStudy ``` The actual tag is red. The strings for the parameters are green. Etc. If something looks the wrong color when you're coding it, you missed something. Most coding text editors use this to help make code more readable. Same goes for Scala. ``` val someVal : Option[String] = None val anotherVal : Option[String] = None for { awesome <- someVal booyan <- anotherVal } yield { awesome + booyan } ``` It highlights None, for, and yield. In all honesty, the should be highlighting val, Option, and String as well - but they're not for some reason.
farmdawgnation
  • farmdawgnation
Lol. Auto-linkification changed some colors in the html example.
lgbasallote
  • lgbasallote
hmm... so if i do this... ``` printf("Colors"); ``` and then i do this... ``` printf("Colors"); switch (colors) case 1: break; default break; ``` why does printf lose its color?
bahrom7893
  • bahrom7893
wait how do u type that again? What comes after ```?
farmdawgnation
  • farmdawgnation
For some reason, lgb, your switch statement makes it think you're using JavaScript.
farmdawgnation
  • farmdawgnation
bahrom: They are code fences, so you can type... \`\`\` printf("Hello World"); \`\`\` And get ``` printf("Hello World"); ```
bahrom7893
  • bahrom7893
Ohhhh, you put them at both ends. Thanks ``` #include using namespace std; int main() { int a, b, systema("pause"); return 0; } ``` This is cool
bahrom7893
  • bahrom7893
Farm, this brings me to my next suggestion. Can you somehow tweak that to show identation?
bahrom7893
  • bahrom7893
*system("pause"); lol
lgbasallote
  • lgbasallote
``` printf("Colors"); if (printf == colored) printf("This code is pretty smart"); else return 0; ```
farmdawgnation
  • farmdawgnation
Indent with spaces, as you should be doing in normal code anyway. :P
farmdawgnation
  • farmdawgnation
We're a spaces shop around here. Tabs can go home.
bahrom7893
  • bahrom7893
In normal code I indent with tabs
bahrom7893
  • bahrom7893
ehhh okay
farmdawgnation
  • farmdawgnation
:P
bahrom7893
  • bahrom7893
bbl guys
lgbasallote
  • lgbasallote
by the way... i had to close this tab multiple times and reopen it because it keeps lagging after i press post (but it still posts for some reaosn though)
farmdawgnation
  • farmdawgnation
Yeah, persisting your reply to the database is asynchronous from the point of view of your browser. So, that still happens. For some reason some of the synchronous portions are gumming up the works. Shadowfiend noticed the same thing a few days ago. We haven't had the chance to look into it yet.

Looking for something else?

Not the answer you are looking for? Search for more explanations.