Welcome to the Builder Academy

Question A Couple Handy Defines

More
10 Sep 2018 10:41 - 10 Sep 2018 11:20 #8204 by Chime
A Couple Handy Defines was created by Chime
Add to structs.h. They have come in pretty handy for formatting things!
Code:
#define HE_SHE(ch) ((GET_SEX(ch) == SEX_MALE ) ? "he" : \ ( (GET_SEX(ch) == SEX_FEMALE) ? "she" : "it" ) ) #define HIS_HER(ch) ((GET_SEX(ch) == SEX_MALE ) ? "his" : \ ( (GET_SEX(ch) == SEX_FEMALE) ? "her" : "its" ) ) #define HIM_HER(ch) ((GET_SEX(ch) == SEX_MALE ) ? "him" : \ ( (GET_SEX(ch) == SEX_FEMALE) ? "her" : "it" ) ) #define MAL_FEM(ch) ((GET_SEX(ch) == SEX_MALE ) ? "male" : \ ( (GET_SEX(ch) == SEX_FEMALE) ? "female" : "something
Code:
#define IS_VOWEL(c) (c == 'A' || c == 'a' || \ c == 'E' || c == 'e' || \ c == 'I' || c == 'i' || \ c == 'O' || c == 'o' || \ c == 'U' || c == 'u' )
Last edit: 10 Sep 2018 11:20 by Chime.
The following user(s) said Thank You: rudeboyrave

Please Log in or Create an account to join the conversation.

More
22 Sep 2018 02:37 #8212 by rudeboyrave
Replied by rudeboyrave on topic A Couple Handy Defines
what do you do with the vowel one? just curious.

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
10 Oct 2018 18:35 #8221 by Chime
Replied by Chime on topic A Couple Handy Defines
I use it for customizing a string to use "a" or "an" based on whether or not the word after it starts with a vowel.

Please Log in or Create an account to join the conversation.

Time to create page: 0.160 seconds