Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lgbasallote Group Title

How does the ``` work? Does it just color the font if the code is right?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. lgbasallote Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ``` i'm talking about this ```

    • 2 years ago
  2. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    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.

    • 2 years ago
  3. lgbasallote Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    i mean the colors...what do they mean?

    • 2 years ago
  4. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    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.. ``` <a href="http://openstudy.com" target="_blank">OpenStudy</a> ``` 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.

    • 2 years ago
  5. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Lol. Auto-linkification changed some colors in the html example.

    • 2 years ago
  6. lgbasallote Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

    • 2 years ago
  7. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    wait how do u type that again? What comes after ```?

    • 2 years ago
  8. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    For some reason, lgb, your switch statement makes it think you're using JavaScript.

    • 2 years ago
  9. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    bahrom: They are code fences, so you can type... \`\`\` printf("Hello World"); \`\`\` And get ``` printf("Hello World"); ```

    • 2 years ago
  10. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Ohhhh, you put them at both ends. Thanks ``` #include <iostream> using namespace std; int main() { int a, b, systema("pause"); return 0; } ``` This is cool

    • 2 years ago
  11. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Farm, this brings me to my next suggestion. Can you somehow tweak that to show identation?

    • 2 years ago
  12. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    *system("pause"); lol

    • 2 years ago
  13. lgbasallote Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ``` printf("Colors"); if (printf == colored) printf("This code is pretty smart"); else return 0; ```

    • 2 years ago
  14. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Indent with spaces, as you should be doing in normal code anyway. :P

    • 2 years ago
  15. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    We're a spaces shop around here. Tabs can go home.

    • 2 years ago
  16. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    In normal code I indent with tabs

    • 2 years ago
  17. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ehhh okay

    • 2 years ago
  18. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    :P

    • 2 years ago
  19. bahrom7893 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    bbl guys

    • 2 years ago
  20. lgbasallote Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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)

    • 2 years ago
  21. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    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.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.