Difference between revisions of "AGIWiki/Managing resources"

Jump to navigation Jump to search
m
Text replacement - "<source lang=" to "<syntaxhighlight lang="
m (Text replacement - "</source>" to "</syntaxhighlight>")
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
 
Line 30: Line 30:
When you are [[AGIWiki/Print|printing]] a [[AGIWiki/Message|message]] to the screen, ''every single letter'' adds a byte to the total amount of memory that the [[AGIWiki/Logic|logic resource]] is using. This means you can't write like a student who's been assigned a 5-page paper and only has 3 pages of content. You must cut the fat.
When you are [[AGIWiki/Print|printing]] a [[AGIWiki/Message|message]] to the screen, ''every single letter'' adds a byte to the total amount of memory that the [[AGIWiki/Logic|logic resource]] is using. This means you can't write like a student who's been assigned a 5-page paper and only has 3 pages of content. You must cut the fat.


<source lang="cpp">
<syntaxhighlight lang="cpp">
print("I do not know whether or not he will come.");
print("I do not know whether or not he will come.");
print("I didn't actually do that in reality.");
print("I didn't actually do that in reality.");
Line 37: Line 37:
The above two print commands are wasting memory! They use far too many characters to say what they're trying to say. Compare to these far better versions:
The above two print commands are wasting memory! They use far too many characters to say what they're trying to say. Compare to these far better versions:


<source lang="cpp">
<syntaxhighlight lang="cpp">
print("I don't know whether he'll come.");
print("I don't know whether he'll come.");
print("I didn't do that."); // OR
print("I didn't do that."); // OR
TrustedUser
2,147

edits

Navigation menu