| View previous topic :: View next topic |
| Author |
Message |
Rinku

Joined: 02 Feb 2003 Posts: 690
|
Posted: Sun Jan 21, 2007 8:39 am Post subject: |
|
|
You know, the begins and ends aren't essential to if statements.
| Code: | if(something else),then
begin
destroy hero (Yay)
#Eat some dinner
end
if(another something else),then
begin
create NPC (Yay)
end |
Could be simplified as:
| Code: | if(something else),then
destroy hero (Yay)
if(another something else),then
create NPC (Yay)
|
Saves some lines of code and makes it easier to read. This only works if only one statement follows an if statement though, when you need to group them you'd need begin and end (or, as I prefer, opening and closing parentheses). _________________ Tower Defense Game |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jan 21, 2007 10:20 pm Post subject: |
|
|
Hehe, too much C/GML for you rinku. Hamsterspeak doesn't support that. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
Rinku

Joined: 02 Feb 2003 Posts: 690
|
Posted: Sun Jan 21, 2007 10:23 pm Post subject: |
|
|
Fine:
| Code: | if(something else),then
(destroy hero (Yay))
if(another something else),then
(create NPC (Yay)) |
_________________ Tower Defense Game |
|
| Back to top |
|
 |
|