This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nolongerexistant's profile picture

Why can't you print an '\' symbol

Started by nolongerexistant, 10 July 2012 - 11:54 PM
nolongerexistant #1
Posted 11 July 2012 - 01:54 AM
So i'm trying to make so ASCII art on Monitors but everytime I use an '' it doesn't get printed.

Here's how it looks on a monitor:


And here's how it should look (half of it):



Why is this happening, and is there a way to still print that symbol?

Thanks
MysticT #2
Posted 11 July 2012 - 02:03 AM
That's because the backslash is the escape character (to add newlines, nulls, etc. to the string), so you need to escape it, adding another backslash.

local s = "" -- string with 1 backslash -> 
MaryuZ #3
Posted 11 July 2012 - 11:06 PM
omg i was just gonna post the exact same question….i thought i'd have to redo all the ascii art again….coding in notepad++ and testing in mc is so tiresome…..is there like another way to test your code?….like a standalone cc emulator?
MysticT #4
Posted 11 July 2012 - 11:31 PM
Not yet. I'm working on one, but won't be ready anytime soon.