Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Printing square brackets

A topic by Garry Francis created Sep 15, 2019 Views: 78 Replies: 5
Viewing posts 1 to 4
Submitted

I wanted to print square brackets using something like:

: print "[Your score has increased by 5 points.]";

but it doesn't print the brackets or anything within the brackets. Square brackets are normally used to contain the elements of an array, but you can't print an array from within a string (as far as I know), so why doesn't this work? I tried escaping the brackets using \[, but this gives an error. The error implied that there were lots of different escape sequences available.

After a bit of trial and error, I found that:

: print "[[Your score has increased by 5 points.]]";

works. Could this and any other escape sequences be documented, please?

Host (2 edits)

You're in luck.

I documented these just a few hours ago...

https://adventuron.io/docs/tut/#QuickStartTextFormattingCodes

https://adventuron.io/docs/tut/#QuickStartEscapeCodes

Submitted(+1)

You're a bloody mind reader! Time to refresh that page again.

Host

The documentation of the palette is in there too.

Still a bit more to do on theming.

Submitted

Ooh, I just discoved ^n^ to eliminate spacing between paragraphs. I can use that for the parchment. (Adventuron knows what I mean.)

Host

Obtuse syntax strikes again :-)