Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Lockpicking?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Rinku




Joined: 02 Feb 2003
Posts: 690

PostPosted: Sun Jan 21, 2007 8:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Jan 21, 2007 10:20 pm    Post subject: Reply with quote

Hehe, too much C/GML for you rinku. Hamsterspeak doesn't support that.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Rinku




Joined: 02 Feb 2003
Posts: 690

PostPosted: Sun Jan 21, 2007 10:23 pm    Post subject: Reply with quote

Fine:

Code:
    if(something else),then
        (destroy hero (Yay))

    if(another something else),then
        (create NPC (Yay))

_________________
Tower Defense Game
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group