Number/variable types relate to resource efficiency etc.

As in why store a number that'll never go higher than 32768 - limit for something like an Int16/short - in a variable of a much larger type, like Int64?

Same principle as in why would you store a piece of paper in a full on rucksack if that's all you were trying to carry in it.

In terms of local and global variables, the theory is that a local variable to only be used within a function/method doesn't need to be available to every other part of the game/script/program etc, and therefore, why would you want the applet to make use of resources to remember it all the time?

Lastly, the general difference between a method and a function, is that while a method will carry out an activity/bit of functionality, a function will return a specific value/result based on either what you asked it to look at/do/handle, and a method would specifically just carry out activities based on same types of input etc., and the use of the Return keyword is simply a form of standardised way of telling a method or function that the process has been completed, but if the function is meant to return an actual output value - as in isn't a void function, it'll then use the keyword to return it's output value.

There are a set of books called:
How to think like a computer scientist

And there are around 5 different versions involving the use of learning to program from a very much beginners point of view, but making use of 5 different types of programming...LOL!

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "dark" <d...@xgam.org>
To: <Gamers@audyssey.org>
Sent: Wednesday, March 24, 2010 8:57 PM
Subject: [Audyssey] Bgt stuff that confuses me


Hi.

Having already read through the tutorial once, I stil find myself mildly confused on a couple of matters.

Firstly, all the stuff relating to doubled short or long intagers and bits and bytes. I'm rather uncertain why or when I would want to use variables such as int8, double, or short which relate to the size of bits and bytes. Shorely, a number is a number and can be written as such?

Secondly, I'm uncertain as to the difference betwene void functions and return result functions, and I must confess I don't follow this example:

void main()
{
int x=add_numbers(3, 5);
alert("Wow", "3 + 5 is... " + x + "!");
}
int add_numbers(int first, int second)
{
int result=first+second;


I can see that the alert will write the text string with the int x, however, hasn't the (3 + 5), already produced the result of 8 for x?

Also, I have absolutely no idea what the business involving "int first" and "int second" is all about, sinse how does bgt know what first and second actually mean? it seems this function is working with a lot of intagers which haven't been defigned successfully, but which work (I tried creating a secript with this and it printed fine).

Any thoughts on this would be appreciated.

Btw, sinse I'm interested in rpg games (and sinse I'm not exactly overflowing with useable sounds), I thought I'd begin by writing a basic text box turn based combat game similar to acefire. I can't promise anything astounding, but I'm hoping it'll be a good exercise for me if nothing els, and teach me something useful about Bgt.

Beware the grue!

Dark.
---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4972 (20100324) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 4972 (20100324) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to