Hello! Today I'm going to show you how to debug with colors in your lovely console ( ^◡^)
I'm sowwy if my engwish is bad (⁄ ⁄>⁄ω⁄<⁄ ⁄)⁄
First Step: wet's see huw it wurksss (*ゝω・)ノ 🍎🍌🍀📘
Okay, so first things first, our terminal has it's own way to interpret color. It basically will escape a certain kind of stuffs and it will interpret it as color for the next stream.
Pwease see this code: 💖💖
2nd Step: wet's make a cwass!
If we wunt to use itt.. Let's make it really easy for us to use!
Pay attention that I defined endl
as \n
because we 💗 codeforces. Just kidding, that's because std::endl
is a weird stuff that can't be defined with simple generics, and it's really weird, endl is more like a function (it's not but just take it for granted). Next, we got this implementation without defining endl
as \n
.
Step 三
Let's see this in action:
Beside windows, linux terminal has the same syntax, I awso have twied it.
Don't be confused with bashfast
and compileCPP
it's basically an alias I've made to access my WSL (Windows Subsystem fow Winux) and to compile C++ code.
ありがとう~! 🐾
I use light mode because it's cwuteeee UωU~~!! 🐾 🐾
N-nice tutowial UωU
Downvoted because of light theme
Upvoted because of light theme
Upvoted because Aeren upvoted.
Light mode UωU 💖💕💓💘💞💝
UωU
UwU <3
(/ =ω=)/ kawaii
Really useful! I'll probably spend the next decade playing with all the different colours.
send me the compensation, my eyes are bleeding cuz you showed me the light theme without any warning.
╚(•⌂•)╝
uwu twice if you need help
Cool trick UwU
It's so pretty uwu
Dark mode user can't enjoy this
Offtopic:
How you all are inserting emojis? When I try to copy paste the same and preview, it says:
Comment preview error:
Emoji (and other unusual UTF-8 characters) are not supported
😀 =
😀
search
html emoji codes
What if I want to do the same on Window?
https://github.com/ikalnytskyi/termcolor
colorblinds : 😑
I would also suggest a simpler trick, though it is less powerful (you cannot decide to print one thing red and the other thing blue, but it works if you want to separate input and output). You can make an alias x="./a.out | lolcat" and run your code with x; you will have rainbow output.
So useful. Those colors will help me debug faster
This stackoverflow answer might also be useful to people: https://stackoverflow.com/questions/287871/how-to-print-colored-text-to-the-terminal
In particular the python library rich really shows off what you can do with this stuff.
sir what does "uwu" and all the chinese/japanase letter mean?????