SmileBASIC is a BASIC interpreter for the Nintendo 3DS.
Like most versions of BASIC, there is a
? which does the same thing)
; does NOT output a trailing newline. This can be tested by comparing it with printing a real newline character:
PRINT "TEST1" 'print + move cursor PRINT "TEST2"+CHR$(10); 'print + newline
CHKCHR, you can see that
TEST2 has a newline character after it, while
TEST1 does not.
You can also use
LOCATE to move the cursor without printing newlines or other special characters.
Many challenges ask you to print lines of text separated by newlines (for example, ASCII art). Is it acceptable to move the cursor in a different way (using PRINT or LOCATE)?
Other challenges specifically say that trailing newlines are not allowed. Should extra cursor movements not be allowed at all?
CHKCHRwork, and how does the system know to print on the next line? \$\endgroup\$
CHKCHR(x,y)returns the ASCII code of the character at x,y in the console. When a newline is printed, the cursor x position is set to 0, and the y position is set to the current line + 1. I guess PRINT just does the same thing on its own. \$\endgroup\$